Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a simple Yes/No dialog box.
If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
bman342 wrote:
I need a simple Yes/No dialog box. If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. if MsgBox ("Message", vbYesNo) = vbYes then .... macro end if |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() bman342 wrote: I need a simple Yes/No dialog box. If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. Try This: Msg = MsgBox("Your Question For User",vbYesNo,) If Msg = vbNo Then Exist Sub If Msg = vbYes Then Your Macro |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bman342,
Try: '============= Public Sub Tester() Dim res As VbMsgBoxResult res = MsgBox(Prompt:="Do you wish to run the Macro?", _ Buttons:=vbYesNo + vbQuestion) If res = vbNo Then Exit Sub 'Your code End Sub '<<============= --- Regards, Norman "bman342" wrote in message ... I need a simple Yes/No dialog box. If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim vRep as Variant
vRep = Msgbox("Do you want to continue",vbYesNo) if vRep = vbYes then <do something end if HTH -- AP "bman342" a écrit dans le message de news: ... I need a simple Yes/No dialog box. If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bman342,
Alternatively, try: '============= Public Sub Tester() Dim res As VbMsgBoxResult res = MsgBox(Prompt:="Do you wish to run the Macro?", _ Buttons:=vbYesNo + vbQuestion) If res = vbYes Then Call myMacro End If End Sub '<<============= --- Regards, Norman "bman342" wrote in message ... I need a simple Yes/No dialog box. If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works fine. Much thanks to both.
"Norman Jones" wrote: Hi Bman342, Alternatively, try: '============= Public Sub Tester() Dim res As VbMsgBoxResult res = MsgBox(Prompt:="Do you wish to run the Macro?", _ Buttons:=vbYesNo + vbQuestion) If res = vbYes Then Call myMacro End If End Sub '<<============= --- Regards, Norman "bman342" wrote in message ... I need a simple Yes/No dialog box. If the User clicks "Yes" it runs a macro that I have already recorded. If "No" it closes the macro. Is there a trusted public library of these types of basic macros somewhere? Thanks so much. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. | Excel Programming | |||
Sending macro based e-mail with built-in "Heading" and "Text" | Excel Programming |