Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dyl dyl is offline
external usenet poster
 
Posts: 1
Default macros -"OK buttons" part way through ?


Is it possible to create a macro that
-displays a message window, and
-requires the user to click on an OK button,
before the macro can finish?

If so, how is it done?

Or does it need to be done with separate macros, one to start the
process, and one that is activated when you click on an OK button
created by the first macro?

Thanks in advance for any help.


--
dyl
------------------------------------------------------------------------
dyl's Profile: http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=518638

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default macros -"OK buttons" part way through ?

Try:
Msgbox "Press OK to continue"

HTH
--
AP

"dyl" a écrit dans le
message de ...

Is it possible to create a macro that
-displays a message window, and
-requires the user to click on an OK button,
before the macro can finish?

If so, how is it done?

Or does it need to be done with separate macros, one to start the
process, and one that is activated when you click on an OK button
created by the first macro?

Thanks in advance for any help.


--
dyl
------------------------------------------------------------------------
dyl's Profile:

http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=518638



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macros -"OK buttons" part way through ?


dyl Wrote:
Is it possible to create a macro that
-displays a message window, and
-requires the user to click on an OK button,
before the macro can finish?

If so, how is it done?

Or does it need to be done with separate macros, one to start the
process, and one that is activated when you click on an OK button
created by the first macro?

Thanks in advance for any help.


Yes you can, by using a message window to request a response from a
user - and do whatever you want depending upon the response. If you
check out VBA help on message boxes you get the following example:
--------------------
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "MsgBox Demonstration" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
--------------------
You could embody this in your existing macro to halt operation until
you get the desired reponse.
Hope this helps
Astrikor


--
astrikor
------------------------------------------------------------------------
astrikor's Profile: http://www.excelforum.com/member.php...o&userid=31465
View this thread: http://www.excelforum.com/showthread...hreadid=518638

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
2007 Need macro to auto set option buttons all to "Yes" or "No" Paula Excel Worksheet Functions 1 October 20th 09 08:07 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Shortcut key for "Paste Options" and "Error Checking" buttons? johndog Excel Discussion (Misc queries) 1 October 6th 06 11:56 AM
"openinf file..."ENABLE MACROS...DISABLE MACROS" F. Lawrence Kulchar Excel Discussion (Misc queries) 3 September 12th 06 10:33 AM
Standard "Open" and "Save As" Buttons Paulo de Arruda Borelli[_2_] Excel Programming 2 September 2nd 04 06:59 AM


All times are GMT +1. The time now is 10:18 PM.

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

About Us

"It's about Microsoft Excel"