Help with code please

G

Greg B

I am wondering how to change this code a little so if the person hits cancel
button on the inputbox it just exits back to the main menu called "main"

Dim ROUND1
ROUND1 = InputBox("WHAT ROUND IS IT?", , Val(Sheet1.Range("B3") + 1))
WEEK1.Visible = False
WEEK2.Visible = False
PRINT1.Visible = False
PRINT2.Visible = False
VIEW1.Visible = False
VIEW2.Visible = False


Thanks
Greg
 
L

Les Stout

Hi Greg,

A simple solution is

Dim ROUND1
ROUND1 = InputBox("WHAT ROUND IS IT?", , Val(Sheet1.Range("B3") + 1))
If ROUND1 = "" Then
main
End If
WEEK1.Visible = False
WEEK2.Visible = False
PRINT1.Visible = False
PRINT2.Visible = False
VIEW1.Visible = False
VIEW2.Visible = False


Best regards,

Les Stout
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top