I wish to write some code that if 2 conditions are met, the code will filter a list of values according to the values of MyFilter3 and MyFilter4. The code I have so far is :
If MyFilter3 <> "" And MyFilter4 <> "" Then
.AutoFilter Field:=3, Criteria1:=">=" & MyFilter3, Operator:=xlAnd, Criteria2:="<=" & MyFilter4
End If
Can someone tell me what's wrong with this? I keep getting an error message saying "Run Time Error 13, Type Mismatch"
Anybody got any ideas as I can't see that there's anything wrong with this code?!
If MyFilter3 <> "" And MyFilter4 <> "" Then
.AutoFilter Field:=3, Criteria1:=">=" & MyFilter3, Operator:=xlAnd, Criteria2:="<=" & MyFilter4
End If
Can someone tell me what's wrong with this? I keep getting an error message saying "Run Time Error 13, Type Mismatch"
Anybody got any ideas as I can't see that there's anything wrong with this code?!