Selecting a print range using a filter/subtotal macro

JerseyRick

Board Regular
Joined
Jan 9, 2006
Messages
65
I use excel to track checks received by our department. I created a macro which only shows the checks received today and creates subtotals based on the pay to field. When I first set this up, it worked fine. However for subsequent days the only thing printing is the header row.

How can I modify the macro below to print only the cells visible with the filter

I appreciate any help provided


Sub Create_Daily_Summary()
'
' Create_Daily_Summary Macro
'

'
ActiveSheet.Range("$A$1:$G$648").AutoFilter Field:=1, Criteria1:= _
xlFilterToday, Operator:=xlFilterDynamic
Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(7), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(7), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Selection.RemoveSubtotal
ActiveSheet.Range("$A$1:$G$648").AutoFilter Field:=1
End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi, can you provide a sample of your data?

I've created my own, and run the macro and it works fine!
 
Upvote 0

Forum statistics

Threads
1,225,156
Messages
6,183,227
Members
453,152
Latest member
ChrisMd

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