Can I print different areas of a spreadsheet using CommandButtons

G

Guy B Machan

I would like to set up a workbook with the first spreadsheet containing a
series of commandbuttons, set into a calendar, that enables the user to print
out information contained in other spreadsheets.
I can set up the commandbutton to do this for one spreadsheet but as there
will be many different prints this would mean many different spreadsheets.
I wanted to know that if I created several named areas in one spreadsheet
whether I could get the commandbutton to print off a named area using the
commandbutton macro. Or is there another solution?
 
J

Jon Peltier

Call this routine for each name on each sheet:

Sub PrintNamedRange(sSheet As String, sRange As String)
Worksheets(sSheet).Range(sRange).Name = "'" & sSheet & "'!Print_Area"
Worksheets(sSheet).PrintOut
End Sub

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top