redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,602
- Office Version
- 365
- Platform
- Windows
Hi all
This is now driving me nuts !
I'm simply trying to AutoFilter column B (of range A:L) using two numbers placed in cells AA1 and AA2 (AA1 is the starting number and AA2 the ending)
However no matter how I format the code it won't filter any data correctly, actually shows nothing. BUT if I auto filter the column myself using NumberFilters>Between and enter the numbers in the "is after or equal to" (cell AA1 value) and "is equal to and before" (cell AA2 value) boxes, the filter works!
any help before I turn to drink, drugs and taking the fish for a walk !!
This is now driving me nuts !
I'm simply trying to AutoFilter column B (of range A:L) using two numbers placed in cells AA1 and AA2 (AA1 is the starting number and AA2 the ending)
VBA Code:
ActiveSheet.Range("$A$1:$L$772").AutoFilter Field:=2, Criteria1:=Range("AA1").Value, Operator:=xlAnd, Criteria2:=Range("AA2").Value
However no matter how I format the code it won't filter any data correctly, actually shows nothing. BUT if I auto filter the column myself using NumberFilters>Between and enter the numbers in the "is after or equal to" (cell AA1 value) and "is equal to and before" (cell AA2 value) boxes, the filter works!
any help before I turn to drink, drugs and taking the fish for a walk !!