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
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,215,039
Messages
6,122,799
Members
449,095
Latest member
m_smith_solihull

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
Back
Top