Hiii alll,
I have a requirement where I should check all the USED cells of an entire column and find if the first 4 letters is PT50.If its not PT50 it must be colored.However my code is going in infinte loopits processing all rows in the sheet.(those without data too).doesn stop.
HELPPPPPPPPPPhow to avoid this infinite loop
this is my code
.Pleeeeeeeeeeeeeese correct it .seekin yr guidance .
![]()
Sub IbanNo() Dim Result As String LR = ActiveSheet.UsedRange.Rows.Count For i = 4 To LR val1 = Cells(i, 16).Value Result = Left(val1, 4) If Not Result Like "PT50" Then Cells(i, 16).Select With Selection.Font .Color = -16776961 .TintAndShade = 0 End With End If Next i End Sub
Bookmarks