How would I go about creating this button?

jackjack583

New Member
Joined
Sep 15, 2016
Messages
9
Hi there,

Just wondering how I would go about creating this button? The button has two options, 1 to either Print or 2 Print to PDF. I would need this to be recorded as a macro and then assign the button. So create a button and give it 2 options but how do I do this?

Any help is appreciated.

Thank you,

Jack
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
.
To accomplish what you are seeking, by way of a MsgBox only, will require a substantial amount of coding.

A simpler approach would be to create a UserForm that looks like a MsgBox, insert three buttons on the UserForm "Print Doc" / "Print to PDF" / "Cancel".

Then for each form button, assign a macro to accomplish the action stated on the button.

Are you ok accomplishing that or will you require assistance ?
 
Upvote 0
maybe something like this?
Code:
Sub test()

    Dim vbAns As Variant


    vbAns = MsgBox(Prompt:="Yes to print, No for pdf", Buttons:=vbYesNoCancel + vbDefaultButton2, Title:="Print to paper?")


    Select Case vbAns
        
        Case vbyes
            Debug.Print "print to printer"
        
        Case vbNo
            Debug.Print "print to pdf"
            
        Case Else
    End Select


End Sub
 
Upvote 0
Two buttons right next to each other can look like a split button?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top