LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default autofilter criteria

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet markx Excel Programming 1 November 24th 06 02:52 PM
Autofilter criteria not yet known JeffMelton Excel Programming 1 July 25th 06 08:12 AM
AutoFilter criteria Mark Excel Programming 1 November 2nd 05 12:08 PM
AutoFilter Criteria VBA EstherJ Excel Programming 2 August 20th 04 12:54 PM
VBA Autofilter Criteria Brandon[_5_] Excel Programming 1 November 7th 03 12:40 PM


All times are GMT +1. The time now is 10:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"