• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 677
  • Last Modified:

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

0
MeMike
Asked:
MeMike
  • 5
  • 5
1 Solution
 
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
MeMikeAuthor Commented:
Great job  Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now