Hi I have a problem when executing code like this on different computers. I have an Excel worksheet where dates are in 9 and 10 columns. I need to apply the following filter
Dim sCriteria1 As String, sCriteria2 As String
sCriteria1 = ">=" & Format(Date, "MM/dd/yyyy")
sCriteria2 = "<" & Format(Date + 60, "MM/dd/yyyy")
Selection.AutoFilter Field:=9, Criteria1:=sCriteria2, Operator:= _
xlAnd
Selection.AutoFilter Field:=10, Criteria1:=sCriteria1, Operator _
:=xlAnd
On my machine it works well, but when I try to run this on another machine it doesnt work. The problem not in Regional settings - i.e. I know that with different regional settings I have to put days before months, like Format(Date, "dd/MM/yyyy"), but this is not the problem
When I run the code, and see the results on the screen, I see that filters are applied (blue arrows in the first row), but no rows are visible. When I click on a filter arrow to open filter window, I see that the condition was set correctly. When I click OK in this filter window (without actually changing anything) filters apply to the data correctly, and now I can see rows that I was expected to see.
Again, this happens on one of the user's machine and doesn't happens on others.