Rowland Hamilton
Active Member
- Joined
- Nov 13, 2009
- Messages
- 250
Folks:
PART I: How come I can't get my autofilter code to work for more than 2 criteria? I keep getting "Criteria doesn't exist" but why should that matter if I'm using "Or"?
If you have solution to only PART I or PART II, please respond.
PART II : Do you have a better idea for deleting the visible rows of filtered data below header row 3? How else can I select that range (something to do with choosing fields first through last?)?
Thank you, Rowland
PART I: How come I can't get my autofilter code to work for more than 2 criteria? I keep getting "Criteria doesn't exist" but why should that matter if I'm using "Or"?
If you have solution to only PART I or PART II, please respond.
PART II : Do you have a better idea for deleting the visible rows of filtered data below header row 3? How else can I select that range (something to do with choosing fields first through last?)?
Code:
Sub Remove_Totals_Blanks_Duplicate_Headers()
'Remove Totals, Blanks and Duplicate Headers
'PART I
Sheets("Incoming").Select
ActiveSheet.AutoFilterMode = False
Rows("3:3").Select
Selection.AutoFilter
'Why doesn't filter work past the first 2 criteria?
Range("A3:I3").AutoFilter Field:=3, _
Criteria1:="*Cost*", _
Operator:=xlOr, Criteria2:="*cost*", _
Operator:=xlOr, Criteria3:="*Total*", _
Operator:=xlOr, Criteria4:="*total*", Operator:=xlOr, Criteria5:="="
'PART II
'Now how do I delete the filtered, visible, contiguous Field 3 rows below my header row 3?
'I think this would do it (worked in my recorderd version)
'Range("C3").Select
'Selection.End(xlDown).Select
'Range(Selection, Selection.End(xlDown)).Select
'Selection.EntireRow.Delete
End Sub
Thank you, Rowland
Last edited: