G
Guest
I have a macro with this code:
Dim i As Long
Dim BMP As Variant
Dim EMP As Variant
Dim RSE As String * 25
For i = 3 To 3
RSE = Worksheets(1).Range("F" & i).Value
BMP = Worksheets(1).Range("D" & i).Value
EMP = Worksheets(1).Range("E" & i).Value
Sheets("TSTF").Select
Selection.AutoFilter Field:=1, Criteria1:=RSE
Selection.AutoFilter Field:=2, Criteria1:=">=BMP", Operator:=xlAnd, _
Criteria2:="<=EMP"
Range("A2:M13806").Select
Selection.Copy
etc. etc.
BMP and EMP are reading numbers like 2.57 and 5.14. If i put those numbers
where the variables are in the critereria code, it works. Why won't it work
with the variables? RSE is working but not BMP and EMP. thank you
Dim i As Long
Dim BMP As Variant
Dim EMP As Variant
Dim RSE As String * 25
For i = 3 To 3
RSE = Worksheets(1).Range("F" & i).Value
BMP = Worksheets(1).Range("D" & i).Value
EMP = Worksheets(1).Range("E" & i).Value
Sheets("TSTF").Select
Selection.AutoFilter Field:=1, Criteria1:=RSE
Selection.AutoFilter Field:=2, Criteria1:=">=BMP", Operator:=xlAnd, _
Criteria2:="<=EMP"
Range("A2:M13806").Select
Selection.Copy
etc. etc.
BMP and EMP are reading numbers like 2.57 and 5.14. If i put those numbers
where the variables are in the critereria code, it works. Why won't it work
with the variables? RSE is working but not BMP and EMP. thank you