![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
Is there anyway to use a message box to run macro?
MsgBox ("Click to run macro") What about having more than one choice on the message box?? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 255
|
See msgbox function in vb help.
There are several optional arguments for the function. msgbox("Would you like to run the macro?",vbyesno,"Run Macro?") Will give you a message box with two buttons. If the person clicks yes, then the function will return the integer 7. So you need an if statement that looks like this: If msgbox("Would you like to run the macro?",vbyesno,"Run Macro?")=7 then Call RunMacro (or something to call the procedure of the macro). The help menu for this function is very useful and will let you know what other buttons you can add. Dave |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|