I have a spreadsheet I create from a subset of another one with a VBA routine. The spreadsheet is getting 2 extra pages at the end of it in print preview mode that I can't explain. Anyone have any suggestions as to what could be causing this?
The VBA code I've used in the past to mitigate this is:
' The following forces a recalculation of what the actual used range is for this
' tab. Sometimes Excel prints blank pages; this fixes that.
a = ActiveSheet.UsedRange.Rows
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.PrintTitleRows = "$20:$20"
.PrintTitleColumns = ""
.Zoom = 100
.FitToPagesWide = 1
'.FitToPagesTall = 1
.LeftFooter = "&""Calibri""&08" & "Centers for Medicare and Medicaid Services" & Chr(10) & _
"FMQAI - Hospital Outpatient Quality Reporting Program Support Contractor"
.RightFooter = "&""Calibri""&08 Page &P of &N "
But that doesn't seem to be working in this instance.