
error al recorrer rango con un bucle for
Publicado por Xabier (2 intervenciones) el 09/07/2021 10:04:04
se queda siempre en el primer valor del rango, alguien sabe por qué puede ser?
Gracias de antemano
Gracias de antemano
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Sub crearlista()
Dim Cosa As String
Dim Celda As Range
For Each Celda In Range("B2:I2")
If Not IsEmpty(Celda.Value) Then
Cosa = ActiveCell.Offset(-1, 0)
With Worksheets("Hoja1").Range("L2").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Cosa
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
Next Celda
End Sub
Valora esta pregunta


0