Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

VBA resume error

I have the following code, which has user enter employee number if blank, or just run the program.
It works if there is no employee number - the box pops up as required.
But if the employee number is there, it errors on "Resume"

Can anyone help?

If Sheets("Queries").Range("F24").Value = True And Sheets("Selection").Range("C1").Value = "" Then Sheets("Selection").Range("C1").Value = InputBox("Must enter your employee number") Else Resume

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Euro5

ASKER

Thanks!!
Actually, could probably do it shorter:

If Sheets("Queries").Range("F24").Value = True And Sheets("Selection").Range("C1").Value = "" Then
Sheets("Selection").Range("C1").Value = InputBox("Must enter your employee number") 
End If
Variable1 = Sheets("Queries").Range("F24").Value
Variable2 = Sheets("Selection").Range("C1").Value

Open in new window