This is my first time ever using a macro, so I'm not sure of what's possible or not. I have an Excel spreadsheet with 4 columns, Column A is quantity, Column B is item code, Column C is item description, and Column D is item cost. I have placed a button on my sheet that uses the code found below. It runs autofilter so that it only displays those items with an entry in column A.
Is there someway to have it adjust the print area automatically so that only the results of the autofilter print? I see a reference in the code to print area, but I have no idea where to start.
Thanks in advance,
Raymond
Private Sub CommandButton1_Click()
'
' Order_Only Macro
' Macro recorded 10/5/2004 by Raymond'
' Keyboard Shortcut: Ctrl+Shift+O
'
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>"
ActiveSheet.PageSetup.PrintArea = ""
ActiveWindow.SmallScroll Down:=-6
End Sub
Is there someway to have it adjust the print area automatically so that only the results of the autofilter print? I see a reference in the code to print area, but I have no idea where to start.
Thanks in advance,
Raymond
Private Sub CommandButton1_Click()
'
' Order_Only Macro
' Macro recorded 10/5/2004 by Raymond'
' Keyboard Shortcut: Ctrl+Shift+O
'
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>"
ActiveSheet.PageSetup.PrintArea = ""
ActiveWindow.SmallScroll Down:=-6
End Sub