Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
have another pause macro problem.
I have created a macro Dim myStr As String myStr = InputBox(Prompt:="Please enter your name") Range("a3").Select ActiveCell.FormulaR1C1 = myStr MsgBox " You entered:" &myStr "other code that does more The input box has 2 options OK and Cancel. If I click on cancel it still continues with the "other code that does more" instead of quiting the macro. Would appreciate any help. Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Ollie wrote: have another pause macro problem. I have created a macro Dim myStr As String myStr = InputBox(Prompt:="Please enter your name") Range("a3").Select ActiveCell.FormulaR1C1 = myStr MsgBox " You entered:" &myStr "other code that does more The input box has 2 options OK and Cancel. If I click on cancel it still continues with the "other code that does more" instead of quiting the macro. Would appreciate any help. Thanks Hi Ollie, If you need to exit the macro when the user clicks cancel you will need something like If myStr = "" Then Exit Sub End If Ken Johnson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks again Ken.
This was an addition to yesterdays question. Its so good to get this help. Thaks a lot Regards Ollie "Ken Johnson" wrote: Ollie wrote: have another pause macro problem. I have created a macro Dim myStr As String myStr = InputBox(Prompt:="Please enter your name") Range("a3").Select ActiveCell.FormulaR1C1 = myStr MsgBox " You entered:" &myStr "other code that does more The input box has 2 options OK and Cancel. If I click on cancel it still continues with the "other code that does more" instead of quiting the macro. Would appreciate any help. Thanks Hi Ollie, If you need to exit the macro when the user clicks cancel you will need something like If myStr = "" Then Exit Sub End If Ken Johnson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You're welcome Ollie, thanks for the feedback.
Ken Johnson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can T Get Macro To Run! | New Users to Excel | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Macro to move to specified cells, pause for input at each? | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |