VBA Print Commands

PilotNinja

New Member
Joined
Mar 24, 2015
Messages
5
Hi everyone,

I come hat in hand again asking for help.

I am trying to incorporate some radio buttons and a print button into an excel worksheet. Ideally, the user would be able to click a radio button which would select a range of cells which the print button would then print.

For example, select the first radio button, lets call it "Shipping Label" then clicking print, would cause a group of cells containing all the info for a shipping label to print. The second label, lets call it "Return Address Label" would then print another set of cells containing the return address information.

I've linked radio buttons to cells and can make the linked cells return a value of either TRUE or FALSE, or different text, but I can't seem to figure out how to link that to what I want to print. Currently I have a print button for every of the 14 print options I need, but some radio buttons would really clean it up for me.

Any help would once again be greatly appreciated!

Thanks in advance.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Code:
Sheets("SourceData").Range("$A$1:$S$36").PrintOut Copies:=1, Collate:=True

There are more options that you can set.
 
Upvote 0
V_Malkoti, Thanks for the response. I know how to make it print, but I am trying to make certain cell ranges print if a box is checked.

AlphaFrog, I am using ActiveX controls.

Thanks!
 
Upvote 0
This is one way to determine which of three ActiveX option buttons is selected.

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] CommandButton1_Click()
    [color=darkblue]Select[/color] [color=darkblue]Case[/color] [color=darkblue]True[/color]
        [color=darkblue]Case[/color] Me.OptionButton1
            Me.Range("A1:B10").PrintOut Copies:=1, Collate:=[color=darkblue]True[/color]
        [color=darkblue]Case[/color] Me.OptionButton2
            Me.Range("D1:E10").PrintOut Copies:=1, Collate:=[color=darkblue]True[/color]
        [color=darkblue]Case[/color] Me.OptionButton3
            Me.Range("G1:H10").PrintOut Copies:=1, Collate:=[color=darkblue]True[/color]
    [color=darkblue]End[/color] [color=darkblue]Select[/color]
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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