Hi,
I'm struggling with the below VBA. I have data In cells A6:S1176 and headings in cells A5:S5.
I want to filter column A based on the value in B1.
I then at the same time want to always filter out anything minus or below 0 in column G.
When I run this macro though I get this error message. 'Run-time error '1004, AutoFilter method of Range class failed'.
Please can someone assist? Not sure what Im doing wrong. If anything Ive asked doesn't make sense, please let me know.
Appreciate anyones help, thank you.
Sub FilterRows()
With Worksheets("Report").Range("A5:S5")
.AutoFilter field:=1, Criteria1:="B1"
.AutoFilter field:=7, Criteria1:=">0"
End With
End Sub
I'm struggling with the below VBA. I have data In cells A6:S1176 and headings in cells A5:S5.
I want to filter column A based on the value in B1.
I then at the same time want to always filter out anything minus or below 0 in column G.
When I run this macro though I get this error message. 'Run-time error '1004, AutoFilter method of Range class failed'.
Please can someone assist? Not sure what Im doing wrong. If anything Ive asked doesn't make sense, please let me know.
Appreciate anyones help, thank you.
Sub FilterRows()
With Worksheets("Report").Range("A5:S5")
.AutoFilter field:=1, Criteria1:="B1"
.AutoFilter field:=7, Criteria1:=">0"
End With
End Sub
Last edited: