Hello all, need some help again. I've written the following macro, however it does not produce any results.
Sub Indent_Row_8()
Dim LR As Long
LR = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 3 Step -1
If ActiveSheet.Cells(i, "B") = Left("8", 1) _
Then Cells(i, "B").IndentLevel = 2
Next i
End Sub
What I would like to do is have a row indented if it starts out with the number 8. For example I have the following in column B:
kl54pl
asr98851
8001pos
olp223
and so I need the macro to indent "8001pos", since it started with the number 8. Most of the time the data will never be the same after the number 8, thus the reason for the LEFT command. Thanks again for looking at my post and any help would be great.
Sub Indent_Row_8()
Dim LR As Long
LR = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 3 Step -1
If ActiveSheet.Cells(i, "B") = Left("8", 1) _
Then Cells(i, "B").IndentLevel = 2
Next i
End Sub
What I would like to do is have a row indented if it starts out with the number 8. For example I have the following in column B:
kl54pl
asr98851
8001pos
olp223
and so I need the macro to indent "8001pos", since it started with the number 8. Most of the time the data will never be the same after the number 8, thus the reason for the LEFT command. Thanks again for looking at my post and any help would be great.