Danny Zeil
New member
I am having trouble with this code as I am unsure of how to redirect the code back to the top of the sub. I tried using the 'call' to get another sub which calls the main sub sum therefore restarting it but after i enter in valid parameters it will enter the table but will also enter the invalid table aswell and I don't want any tables higher than 30 columns or rows to be created on the document.
Sub sum()
Dim num1 As Double
Dim num2 As Double
num1 = InputBox("Please enter the number of rows: ")
num2 = InputBox("Please enter the number of columns: ")
If num1 > 30 Or num1 < 1 Then
Call retry
Else
If num2 > 30 Or num2 < 1 Then
Call retry
End If
End If
End sub
Thanks for looking
Sub sum()
Dim num1 As Double
Dim num2 As Double
num1 = InputBox("Please enter the number of rows: ")
num2 = InputBox("Please enter the number of columns: ")
If num1 > 30 Or num1 < 1 Then
Call retry
Else
If num2 > 30 Or num2 < 1 Then
Call retry
End If
End If
End sub
Thanks for looking
