Thread: Pause Macro 2
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default Pause Macro 2


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