#1   Report Post  
Posted to microsoft.public.excel.misc
Ollie
 
Posts: n/a
Default Pause Excel Macro

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
Ollie
 
Posts: n/a
Default Pause Excel Macro

Thank you Ken

This works very well for me.
Very much appreciate you help
Regards
Ollie

"Ken Johnson" wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default Pause Excel Macro


You're welcome Ollie, thanks for the feedback.

Ken Johnson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Outlook Alias into an Excel 2003 macro fidgitthedigit Excel Discussion (Misc queries) 0 May 29th 06 02:24 PM
Excel macro [email protected] Excel Discussion (Misc queries) 1 May 27th 06 04:00 PM
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Relative Ranges in excel macro edself Excel Worksheet Functions 6 October 13th 05 02:02 PM


All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"