bartoni
07-12-2004, 05:14 AM
Hi,
This is my code which asks for user input and opens specfic workbooks accordingly. The problem is if is start the first inputbox (country) and click cancel on the inputbox, it doesnt cancel but brings up the next input box. How do you make the cancel button stop the macro?
Sub old_access()
country = InputBox("Data from which Analogue country:")
quarter = InputBox("Data from which Analogue production (i.e 403) :")
Workbooks.Open FileName:="c:\macros\" & country & "_promo_q" & quarter & ".xls"
Workbooks.Open FileName:="c:\macros\" & country & "_profile_q" & quarter & ".xls"
Workbooks.Open FileName:="C:\macros\test.xls"
This is my code which asks for user input and opens specfic workbooks accordingly. The problem is if is start the first inputbox (country) and click cancel on the inputbox, it doesnt cancel but brings up the next input box. How do you make the cancel button stop the macro?
Sub old_access()
country = InputBox("Data from which Analogue country:")
quarter = InputBox("Data from which Analogue production (i.e 403) :")
Workbooks.Open FileName:="c:\macros\" & country & "_promo_q" & quarter & ".xls"
Workbooks.Open FileName:="c:\macros\" & country & "_profile_q" & quarter & ".xls"
Workbooks.Open FileName:="C:\macros\test.xls"