Hi
I have a loop like below:
For i = 2 to Ubound(Unit)
m = 0
Do
m = m + 1
Loop until Data(m,1) = Unit(i,1) and Data(m,4) = NoC(i,1)
'then do something once you found match
Next i
However sometimes there is no match and i want it to log on a sheet named error for which Unit(i,1) there was no match and then continue. How would i capture that in the loop.
Thanks
I have a loop like below:
For i = 2 to Ubound(Unit)
m = 0
Do
m = m + 1
Loop until Data(m,1) = Unit(i,1) and Data(m,4) = NoC(i,1)
'then do something once you found match
Next i
However sometimes there is no match and i want it to log on a sheet named error for which Unit(i,1) there was no match and then continue. How would i capture that in the loop.
Thanks