Macro Problem

C

carl

I am trying to build a macro to automate some of my worksheet filtering.
Here's what I have been trying to use:

Sub StrikeCheck()
For i = 3 To 3
Range("B" & i).Select
Dim A As String
A = "=" & Range("B" & i).Value
Dim B As String
B = ">=" & Range("D" & i).Value
Dim C As String
C = "<=" & Range("E" & i).Value
Dim D As String
D = "=" & Range("F" & i).Value
Dim E As String
E = "=" & Range("G" & i).Value
Sheets("configman").Select

Selection.AutoFilter Field:=4, Criteria1:=A, Operator:=xlAnd

Selection.AutoFilter Field:=6, Criteria1:=B, Operator:=xlAnd, _

Criteria2:=C

Selection.AutoFilter Field:=5, Criteria1:=D, Operator:=xlAnd

Next i

End Sub

The Macro does not preform the last Filter, For Criteria=D correctly. The
values in theat column are dates. The value that is being put into the filter
is a formated date and is a result of a formula.

Are there some suggestions on how I can get this to work ?

Thank you in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top