Hi Everyone,
I seem to be pestering you all daily at the minute so apologies.
Im trying to apply an autofilter to a column based on the value in cell D2. Heres what I have.......
[CODE][/Sub Filterfirstvalue()
Dim station As Range
firstvalue = Range("D2").Value
If firstvalue = "All" Then ActiveSheet.Range("$B$8:$DV$314").AutoFilter
ElseIf ActiveSheet.Range("$B$8:$DV$314").AutoFilter Field:=3, Criteria1:=Range("D2")
End SubCODE]
Im struggling with the else portion I think.
In short, I want to input "4" in cell D2 - Only the "4"'s are shown. I am fine with this bit as I have recorded that.
I also want to be able to leave the cell blank, alternatively type "All", or something similar, and everything will be shown again. This is where I fail.
Please can you help?
Im starting to realise that I am not a natural VBA'er!
Kind regards
Alex
Bookmarks