Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Only Certain Columns In Excel to Print 1

Status
Not open for further replies.

nickjar2

Programmer
Jun 20, 2001
778
US
I hope someone can help on this (probably easy) problem.

Say for example I have a standard worksheet with the range A1 to G10 having data in.
When a user clicks a button (print) I don't want the whole page to print. What I need is this:
Column A and Column B should print on ONE page.
On page TWO, column A and col C should print.
On page THREE col A and D etc etc.

I know this is probably an easy problem but I just cannot seem to work out how to do it.

Cheers 4 any help,

Nick
 
hi nickjar2

File, Page Setup, Columns to repeat at left (on the "Sheet" Tab).
Then just insert page breaks before column C, D, etc.

pjm
 
Cheers pjm. That worked perfectly. Also, is this easy to do in code. The reason is that say the A column is dynamic or doesn't that matter.

Thanks again,

Nick
 
Hi Nick

I just recorded a macro and got the following code:

sub repeat_columns()
ActiveSheet.PageSetup.PrintTitleColumns = "$A:$A"
end sub

(So you could have "$A:$B" to print A and B on every page.)

Regards,
pjm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top