Hello Coders,
I have this loop, I get a range of specific cells and then I loop over this collection searching for a value, if this value exist I wanted to move one place to the right and then set a value on that cell, but for some reason when I put this offser(0,1) parameter, the loop became infinite, not sure why the code is doing this:
Any help would be very appreciated,
Regards
I have this loop, I get a range of specific cells and then I loop over this collection searching for a value, if this value exist I wanted to move one place to the right and then set a value on that cell, but for some reason when I put this offser(0,1) parameter, the loop became infinite, not sure why the code is doing this:
Code:
For Each c In Worksheets("Parameters").Range("A3:AR3").Cells
adress_start = ""
adress_letter = ""
adress_end = ""
If c.Value = "Row Order" Then
adress_start = c.Address
adress_letter = Mid(c.Address, 2, InStr(2, c.Address, "$") - 2)
adress_end = adress_letter & "10"
For Each cAux In Worksheets("Parameters").Range(adress_start & ":" & adress_end).Cells
If cAux.Value <> "" And cAux.Value <> "Row Order" Then
MsgBox "cAux adress" & cAux.Address
' move one place to the right and set a value
cAux.Offset(0, 1).Value = "X value"
End If
Next
End If
Next
Any help would be very appreciated,
Regards