Ampleford
Active Member
- Joined
- Mar 26, 2002
- Messages
- 380
I have an inputbox which asks for some info, drops that on a spread then prints the spread based on that info. All well - except when you press the "Cancel" button - it still runs the Macro... What is the syntax to make it stop ?
My script for the macro so far is :-
Prdno = InputBox("Please enter the Period you wish to print", "Enter Period")
Sheets("Register").Select
Range("A1:C1").Select
ActiveWorkbook.Unprotect
Sheets("Data").Visible = True
Sheets("Data").Select
Range("e1").Select
Selection.FormulaR1C1 = Prdno
Sheets("Register").Select
Range("D1:E1").Select
ActiveCell.FormulaR1C1 = "=Data!RC[2]"~~~~~~~~~ Etc
I know there needs to be a line after the first which acknowledges and actions the "Cancel" button...
Help please ?
My script for the macro so far is :-
Prdno = InputBox("Please enter the Period you wish to print", "Enter Period")
Sheets("Register").Select
Range("A1:C1").Select
ActiveWorkbook.Unprotect
Sheets("Data").Visible = True
Sheets("Data").Select
Range("e1").Select
Selection.FormulaR1C1 = Prdno
Sheets("Register").Select
Range("D1:E1").Select
ActiveCell.FormulaR1C1 = "=Data!RC[2]"~~~~~~~~~ Etc
I know there needs to be a line after the first which acknowledges and actions the "Cancel" button...
Help please ?