Hi everyone,
I can't figure out how to make my simple for loop code show an error message when it no longer finds any cell(s) that meet the criteria. The criteria is that the first cell must match "K1110" while 4 cells to it's right must be blank. Please note that this code works fine. But, how can I make it say "nothing found" if it found nothing? And make it say "only 2 were done" out of X?
I tried to search for a solution but with not luck. Please help.
For X = 1 To 3
For Each cel In SRng1
If cel = Range("K1110") And cel.Offset(0, 4) = "" Then
cel.Offset(0, 3) = Range("L1110")
cel.Offset(0, 4) = Range("M1110")
Exit For
End If
Next cel
Next X
==========
All the best,
-m
I can't figure out how to make my simple for loop code show an error message when it no longer finds any cell(s) that meet the criteria. The criteria is that the first cell must match "K1110" while 4 cells to it's right must be blank. Please note that this code works fine. But, how can I make it say "nothing found" if it found nothing? And make it say "only 2 were done" out of X?
I tried to search for a solution but with not luck. Please help.
For X = 1 To 3
For Each cel In SRng1
If cel = Range("K1110") And cel.Offset(0, 4) = "" Then
cel.Offset(0, 3) = Range("L1110")
cel.Offset(0, 4) = Range("M1110")
Exit For
End If
Next cel
Next X
==========
All the best,
-m