lharnage7331
New Member
- Joined
- Apr 21, 2021
- Messages
- 6
- Office Version
- 2016
Hello
I filter out all cells that are blank. Insert Formula. Drag Down formula. Unfilter. Clear filters. However, when i run the macro it takes the header in the column above and drags it down instead of takin that active cell and dragging the formula down to the filtered cells.
The idea is simple. Counting in progress or employees on leave or not. Just switching formulas back and forth.
PS-This file uses the subtotal function so I have to filter out non-store lines so the subtotal function works under each region/district. I'm doing something wrong with the select AG6 and Selection.Filldown I just dont know what.
Sub In_Progress()
'
' In_Progress Macro
'
'
Rows("5:5").Select
Selection.AutoFilter
ActiveSheet.Range("$A$5:$EC$3192").AutoFilter Field:=12, Criteria1:="<>"
Range("AG6").Select
ActiveCell.Formula = "=IF((V6+W6)-AF6=0,"" - "",(V6+W6)-AF6)"
Range("AG6").Select
Selection.FillDown
Range("AK6").Select
ActiveCell.Formula = "=IF((AB6+AC6)-AJ6=0,"" - "",(AB6+AC6)-AJ6)"
Range("AK6").Select
Selection.FillDown
Range("AL6").Select
ActiveCell.Formula = "=IF((AB6+AC6)-AJ6=0,"" - "",(AB6+AC6)-AJ6)"
Range("AL6").Select
Selection.FillDown
ActiveSheet.ShowAllData
Rows("5:5").Select
Range("R5").Activate
Selection.AutoFilter
Range("H1").Select
End Sub
I filter out all cells that are blank. Insert Formula. Drag Down formula. Unfilter. Clear filters. However, when i run the macro it takes the header in the column above and drags it down instead of takin that active cell and dragging the formula down to the filtered cells.
The idea is simple. Counting in progress or employees on leave or not. Just switching formulas back and forth.
PS-This file uses the subtotal function so I have to filter out non-store lines so the subtotal function works under each region/district. I'm doing something wrong with the select AG6 and Selection.Filldown I just dont know what.
Sub In_Progress()
'
' In_Progress Macro
'
'
Rows("5:5").Select
Selection.AutoFilter
ActiveSheet.Range("$A$5:$EC$3192").AutoFilter Field:=12, Criteria1:="<>"
Range("AG6").Select
ActiveCell.Formula = "=IF((V6+W6)-AF6=0,"" - "",(V6+W6)-AF6)"
Range("AG6").Select
Selection.FillDown
Range("AK6").Select
ActiveCell.Formula = "=IF((AB6+AC6)-AJ6=0,"" - "",(AB6+AC6)-AJ6)"
Range("AK6").Select
Selection.FillDown
Range("AL6").Select
ActiveCell.Formula = "=IF((AB6+AC6)-AJ6=0,"" - "",(AB6+AC6)-AJ6)"
Range("AL6").Select
Selection.FillDown
ActiveSheet.ShowAllData
Rows("5:5").Select
Range("R5").Activate
Selection.AutoFilter
Range("H1").Select
End Sub