Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing non-adjacent columns | Excel Discussion (Misc queries) | |||
print excel columns on less pages | Excel Discussion (Misc queries) | |||
Columns in Excel will not allow user to click in them | Excel Discussion (Misc queries) | |||
Counting the Contents of Two Columns | Excel Discussion (Misc queries) | |||
Printing multiple columns on one page | Excel Discussion (Misc queries) |