SAMCRO2014
Board Regular
- Joined
- Sep 3, 2015
- Messages
- 160
I am using a filter to show all "BB" transactions and delete the rest of the rows that are not "BB". Here is what I recorded when I did it:
'Set autofilter on Column E for "BB" and delete all other rows
Range("A1").Select
Sheets("PPDR_BB").Select
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$T$15865").AutoFilter Field:=5, Criteria1:=Array( _
"#N/A", "Overtime", "PAR", "Premiums", "Regular"), Operator:=xlFilterValues
Range("A634").Select
Range(Selection, Selection.End(xlToRight)).Select
Range("A634:P634").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
ActiveSheet.Range("$A$1:$T$633").AutoFilter Field:=5
My question is how can I adjust the coding to delete the rows under the headings that I do not require as the starting row will be variable.
Thanks
'Set autofilter on Column E for "BB" and delete all other rows
Range("A1").Select
Sheets("PPDR_BB").Select
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$T$15865").AutoFilter Field:=5, Criteria1:=Array( _
"#N/A", "Overtime", "PAR", "Premiums", "Regular"), Operator:=xlFilterValues
Range("A634").Select
Range(Selection, Selection.End(xlToRight)).Select
Range("A634:P634").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
ActiveSheet.Range("$A$1:$T$633").AutoFilter Field:=5
My question is how can I adjust the coding to delete the rows under the headings that I do not require as the starting row will be variable.
Thanks