I keep getting a print error. I think it says Overflow and might even something else at one point. At one point after making a change to Columns range "A1:A" to "C1:C" it worked without error but then error came back.
I have two tabs with income statements that I need to print and fit to one page filling the page without margins regardless of whether rows are grouped or ungrouped (consolidate or with detail). One tab as colums A & B hidden and the other A,B,C,D,E columns hidden. Picture will show where VBA is telling where the issue is.
Any help please?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.PrintCommunication = True
With ActiveSheet.PageSetup
If Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Count < Cells(Rows.Count, 1).End(xlUp).Row Then
'Worksheet Grouped
.FitToPagesWide = 1
.FitToPagesTall = 1
Else
'Workbook Not Grouped
.Zoom = 100
End If
End With
Application.PrintCommunication = False
End Sub
I have two tabs with income statements that I need to print and fit to one page filling the page without margins regardless of whether rows are grouped or ungrouped (consolidate or with detail). One tab as colums A & B hidden and the other A,B,C,D,E columns hidden. Picture will show where VBA is telling where the issue is.
Any help please?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.PrintCommunication = True
With ActiveSheet.PageSetup
If Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Count < Cells(Rows.Count, 1).End(xlUp).Row Then
'Worksheet Grouped
.FitToPagesWide = 1
.FitToPagesTall = 1
Else
'Workbook Not Grouped
.Zoom = 100
End If
End With
Application.PrintCommunication = False
End Sub