Hi All;
I am sure that this is an easy one, but I forgot how to finish this code off.
The goal is for a user to enter a starting number (i) between 1 to 120. If the number is within the range of 1 to 120, it runs the IF statement. Once the IF statement is run, I'd like to perform a Next i operation. The code would end once i is greater than 120. The problem is where to put the For and Next statements.
Here is my code:
I am sure that this is an easy one, but I forgot how to finish this code off.
The goal is for a user to enter a starting number (i) between 1 to 120. If the number is within the range of 1 to 120, it runs the IF statement. Once the IF statement is run, I'd like to perform a Next i operation. The code would end once i is greater than 120. The problem is where to put the For and Next statements.
Here is my code:
Code:
Sub multi_panel_2()
Dim i As Single
i = InputBox("What panel number would you like to start with?", "Starting Panel Number")
If i >= 1 And i <= 120 Then
confirm = MsgBox("Are you ready to run file " & "panel" & i & ".tap" & " ?", vbOKCancel)
If confirm = 1 Then
MsgBox ("run " & i & ".tap") ' placeholder for file call
' loadrun("c:\CNC\panel" & i & ".tap")
' code "M00"
Else: End If 'place holder for code "M30" End If
Else: MsgBox ("You entered Panel " & i & ". " & "Panel number is outside the range of 1 to 120.")
End If
End Sub