Heya,
Excel is coming up with an error saying: "Loop without Do", while there is a Do statement in place (as per code below). Any tips?
Effectively I want the DO Loop to run if the 2nd Cell in a row is empty for the intent to copy data into another worksheet, in addition it must skip over where the quantity in another cell is empty or 0
Cheers in advance.
Excel is coming up with an error saying: "Loop without Do", while there is a Do statement in place (as per code below). Any tips?
Effectively I want the DO Loop to run if the 2nd Cell in a row is empty for the intent to copy data into another worksheet, in addition it must skip over where the quantity in another cell is empty or 0
Cheers in advance.
Code:
Dim r As Long, sr As Long
r = 5
sr = 16
Do While Not IsEmpty(Cells(r, 2).Value)
'Qnty Ignore
If Cells(r, 3) > 0 Then
'Error Checking: Item Number present?
If Cells(r, 1).Value < 1 Then
INOINVAL:
INo = Application.InputBox("ALDI Item No. Missing for " & Cells(r, 2).Value & " Please enter it now", Type:=1)
If INo < 1 Then
Msgbox ("Incorrect. Must be a 5 digit number")
GoTo INOINVAL
End If
Cells(r, 1).Value = INo
'copying text into SI
SI.Cells(sr, 1).Value = OI.Cells(r, 1).Value
SI.Cells(sr, 2).Value = OI.Cells(r, 2).Value
SI.Cells(sr, 3).Value = OI.Cells(r, 3).Value
sr = sr + 1
t = r + 1
End If
Loop