Pause Excel Macro
Ollie wrote:
I have followed a discussion group suggestion and created a macro as follows:
dim myStr as string
"your code that does something'
mystr = inputbox (Prompy:= "Please type something")
msgbox "Hey, you typed: " & mystr
"your code that does more'
This works well thanks to Dave Peterson but when I run the macro it gives 2
option Cancel and OK. I was wondering if it can be created to only give the
OK option so that something must be entered to continue.
Thanks
Hi Ollie,
Here's one way...
Public Sub MustEnter()
Dim mystring As String
Do While mystring = ""
mystring = InputBox("Please type something")
If mystring = "" Then MsgBox _
"You're not getting off that lightly buster!"
Loop
MsgBox "You typed " & mystring
End Sub
According to the help files there is no option for changing the
inputbox buttons.
Ken Johnson
|