Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ann Shaw
 
Posts: n/a
Default Printing non-adjacent columns

Hi

I know I can hide columns I don't want to print and I know
I can use Group and Outline but that means I have to do
this each time to the columns I want to print and they
could be different each time in the spreadsheet - is there
a quicker way using a macro or something?

Basically I have 45 columns and sometimes I want to print
for example A:E,G,M-P,T and sometimes I want to print
other combinations of columns.

Thanks

Ann
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Record a macro when you hide your columns, print the worksheet, and unhide the
columns.

Then you could use that as the basis of your code to print the columns you need
to print.

This is what I ended up with (printpreview, though):

Option Explicit
Sub testme()
Dim myRng As Range
With ActiveSheet
Set myRng = .Range("A:E,G:G,M:P,T:T")
.UsedRange.Columns.Hidden = True
myRng.EntireColumn.Hidden = False
.PrintOut preview:=True
.UsedRange.Columns.Hidden = False
End With
End Sub

You could even add some buttons to the worksheet that were assigned to the
different "prints".



Ann Shaw wrote:

Hi

I know I can hide columns I don't want to print and I know
I can use Group and Outline but that means I have to do
this each time to the columns I want to print and they
could be different each time in the spreadsheet - is there
a quicker way using a macro or something?

Basically I have 45 columns and sometimes I want to print
for example A:E,G,M-P,T and sometimes I want to print
other combinations of columns.

Thanks

Ann


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing non-adjacent columns Ann Shaw Excel Discussion (Misc queries) 2 February 16th 05 04:45 PM
print excel columns on less pages a_ryan1972 Excel Discussion (Misc queries) 1 February 9th 05 05:41 PM
Columns in Excel will not allow user to click in them Kim Excel Discussion (Misc queries) 1 December 28th 04 06:37 PM
Counting the Contents of Two Columns Molochi Excel Discussion (Misc queries) 6 December 22nd 04 08:13 PM
Printing multiple columns on one page tdj Excel Discussion (Misc queries) 4 December 2nd 04 02:55 AM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"