Concatenate printareas

PaulS

Board Regular
Joined
Feb 26, 2006
Messages
66
To the Excel/Printing expert,
I made a macro for printing the 12 sheets (named 'jan', 'feb'...etc).
Besides some user questions the macro has 12 times the following statement:
(generated via the 'recording macro' function)
Sheets("jan").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
For each sheet the printing area has been defined for the maximum number of lines.
Printing of 12 reports works nice, but
I have two questions:
1.The report is printed on the default printer. This is not what I want. I would like the 'ín between window' where I can select the printer. How do I get that window?
2.Early in the year the monthly reports are short. Is it possible to set the printarea in the macro? The lines to be printed can easily be calculated: (data lines start at row 7) col A holds a number . The highest number is the last line to be printed. Can printed areas of the 12 sheets be printed in one report (header taken from sheet 'jan' – rows 1-6)?
Thanks for your help.
Paul
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,651
Try

Code:
Application.Dialogs(xlDialogPrint).Show
 

PaulS

Board Regular
Joined
Feb 26, 2006
Messages
66
Thank you. Q1 solved. That's what I was looking for. Where can I find such VBA coding instructions?
Any idea about my second question? Is it possible?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,651
You can set the print area like this

Code:
ActiveSheet.PageSetup.PrintArea = "A7:N" & Range("A" & Rows.Count).End(xlUp).Row
Change N to your rightmost column.

I don't know a way (other than by copying and pasting to a separate sheet) of concatenating the printing from several sheets.
 

PaulS

Board Regular
Joined
Feb 26, 2006
Messages
66
Thank you Peter,
I will try to implement your suggestion of copying the rows to a new worksheet, which is for printing only.
Thanks,
Paul
 

Forum statistics

Threads
1,081,850
Messages
5,361,687
Members
400,648
Latest member
mamamia93

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top