Macro Print Error

jkle4596

New Member
Joined
Feb 18, 2016
Messages
7
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
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Watch MrExcel Video

Forum statistics

Threads
1,122,657
Messages
5,597,391
Members
414,142
Latest member
Banyangt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top