Excel Print Macros

Good Evening,

I have a signal excel workbook created in office 2010 Std with 6 worksheets; all sheets have the print area's set to print on a signal page. What I need to do and I'm trying to figure out is how to create a macro button that I will place on sheet 1 so when pressed will bring up a menu to chose which sheets to need to be printed.

thank you  in advance,

MA

MeMikeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SiddharthRoutCommented:
Is this what you want?

Sample file attached. Please amend it to suit your needs.

Sid

Code Used

Private Sub UserForm_Initialize()
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Sheets
        ComboBox1.AddItem ws.Name
    Next
End Sub

Open in new window

Print-Sample.xlsm
0
MeMikeAuthor Commented:
Its seems very simple but I can't get it to print to my default network printer nothing prints no error message
0
SiddharthRoutCommented:
Show me the code that you are using? Or better still upload your file.

Sid
0
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

MeMikeAuthor Commented:
is this a macro or a VB script?
0
MeMikeAuthor Commented:
To make it easy for myself I uncerted all tabs (worksheets) to your doc but I even re-downloaded your sample file and tried to print?
No work!!
0
SiddharthRoutCommented:
The file that I gave doesn't print. It is to show you how to populate the sheetnames in the combo as you requested. I thought you already had the 'Print Code'. You have to write another few lines in the click event of the button to print.

What exactly do you want to print? I'll update the code and post it back.

Sid
0
MeMikeAuthor Commented:
To print to the default print of the machine/PC that opens the file.

Sorry :(
0
SiddharthRoutCommented:
Ok. give me few moments :)

Sid
0
SiddharthRoutCommented:
Try this file.

Sid

Code Used

Private Sub CommandButton1_Click()
    Sheets(ComboBox1.Text).PrintOut
End Sub

Private Sub UserForm_Initialize()
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Sheets
        ComboBox1.AddItem ws.Name
    Next
End Sub

Open in new window

Print-Sample.xlsm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MeMikeAuthor Commented:
Great job  Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Spreadsheets

From novice to tech pro — start learning today.