I have a stores order spreadsheet with >200 line items. When ordering items I may only require say 9 of the items from the total list. Therefore when I print the order I only want the rows that have a qty in column E. I have adapted a macro from an online source to print only the selected items. The only items that are printed are those with a value in col E, however, I get 4 pages of report with the footer printed. The print does not stop at the end of the list of items with a val in col E. What do I need to change on the macro to stop the waste of printed paper.
Sub PrintOrderCosting()
'prints rows of data, will not print rows if column E is blank
Application.ScreenUpdating = False
Range("E13:E250").EntireRow.Hidden = False
Range("E13:E250").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("E13:E250").EntireRow.Hidden = False
Application.ScreenUpdating = True
Range("a1:h250").Select
ActiveSheet.PageSetup.PrintArea = "$a$1:$h$250"
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$a$1:$h$250"
Application.PrintCommunication = False
Application.ScreenUpdating = True
ActiveWorkbook.RefreshAll
End Sub
Sub PrintOrderCosting()
'prints rows of data, will not print rows if column E is blank
Application.ScreenUpdating = False
Range("E13:E250").EntireRow.Hidden = False
Range("E13:E250").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("E13:E250").EntireRow.Hidden = False
Application.ScreenUpdating = True
Range("a1:h250").Select
ActiveSheet.PageSetup.PrintArea = "$a$1:$h$250"
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$a$1:$h$250"
Application.PrintCommunication = False
Application.ScreenUpdating = True
ActiveWorkbook.RefreshAll
End Sub