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.
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.
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" <[email protected]> wrote in message
news:[email protected]...
>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.
dim vRep as Variant
vRep = Msgbox("Do you want to continue",vbYesNo)
if vRep = vbYes then
<do something>
end if
HTH
--
AP
"bman342" <[email protected]> a écrit dans le message de
news: [email protected]...
>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.
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" <[email protected]> wrote in message
news:[email protected]...
>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.
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" <[email protected]> wrote in message
> news:[email protected]...
> >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.
>
>
>
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks