L
Leigh Douglass
Hi
I have recorded a macro to hide certain columns on my sheet, then to print
the sheet and then unhide the columns. The code looks ok, but when it prints
I am only getting 2 columns instead of the whole document. Any help
gratefully received, macro code below. Thanks
Private Sub CommandButton3_Click()
'
' print_mode Macro
' Macro recorded 02/09/2008 by Leigh Douglass'
'
Columns("B:B").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=1
Columns("M:N").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=3
Columns("P:AF").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=-9
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Columns("A:C").Select
Range("C1").Activate
Selection.EntireColumn.Hidden = False
ActiveWindow.SmallScroll ToRight:=4
Columns("L:O").Select
Range("O1").Activate
Selection.EntireColumn.Hidden = False
ActiveWindow.SmallScroll ToRight:=3
Columns("O:AG").Select
Range("AG1").Activate
Selection.EntireColumn.Hidden = False
Range("A1").Select
End Sub
I have recorded a macro to hide certain columns on my sheet, then to print
the sheet and then unhide the columns. The code looks ok, but when it prints
I am only getting 2 columns instead of the whole document. Any help
gratefully received, macro code below. Thanks
Private Sub CommandButton3_Click()
'
' print_mode Macro
' Macro recorded 02/09/2008 by Leigh Douglass'
'
Columns("B:B").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=1
Columns("M:N").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=3
Columns("P:AF").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=-9
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Columns("A:C").Select
Range("C1").Activate
Selection.EntireColumn.Hidden = False
ActiveWindow.SmallScroll ToRight:=4
Columns("L:O").Select
Range("O1").Activate
Selection.EntireColumn.Hidden = False
ActiveWindow.SmallScroll ToRight:=3
Columns("O:AG").Select
Range("AG1").Activate
Selection.EntireColumn.Hidden = False
Range("A1").Select
End Sub