Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
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 | |||
Importing Outlook Alias into an Excel 2003 macro | Excel Discussion (Misc queries) | |||
Excel macro | Excel Discussion (Misc queries) | |||
Macro Help In Excel | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Relative Ranges in excel macro | Excel Worksheet Functions |