G
Guest
Any help would be appreciated. I have been told that GoTo used in anything
other than error handling should be avoided. THe code below works just like
I want it to, but I was wondering if anyone had any ideas for removing the
GoTo. I have tried a
Do Until, but that didn't give me the same results.
TIA,
Kim
For i = 1 To lIndex
TryAgain:
If MyRV(i).sMonName = .ActiveCell.Offset(iPlace, 1).Value Then
.ActiveCell.Offset(iPlace, 0).Value = MyRV(i).sEngineFamily
.ActiveCell.Offset(iPlace, 2).Value = MyRV(i).dRepairCount
iPlace = iPlace + 1
Else
iPlace = iPlace + 1
GoTo TryAgain
End If
Next i
other than error handling should be avoided. THe code below works just like
I want it to, but I was wondering if anyone had any ideas for removing the
GoTo. I have tried a
Do Until, but that didn't give me the same results.
TIA,
Kim
For i = 1 To lIndex
TryAgain:
If MyRV(i).sMonName = .ActiveCell.Offset(iPlace, 1).Value Then
.ActiveCell.Offset(iPlace, 0).Value = MyRV(i).sEngineFamily
.ActiveCell.Offset(iPlace, 2).Value = MyRV(i).dRepairCount
iPlace = iPlace + 1
Else
iPlace = iPlace + 1
GoTo TryAgain
End If
Next i