KG Old Wolf
Board Regular
- Joined
- Sep 20, 2009
- Messages
- 65
All,
I've read through the posts yet I cannot see what I am doing wrong....spent hours before posting.
I have a variable that I want to use in an auto filter. I've stripped the code to the barest minimum and still - no go. It is needed for use with a user form through wich the variable will be set by the ControlSource of a drop down list. But I can't get even the simplest code to work. All contributions are really appreciated. (The variable KG_Test is getting the proper number - I've also tried defining the variable with different data types (Long, Integer etc.)
'
'
Sub Human()
'
' Attempt to use a variable within an autofilter
'
KG_Test = Range("Input")
'
On Error Resume Next
ActiveSheet.ShowAllData
'
Range("D").Select
ActiveSheet.Range("db_Timesheet").AutoFilter Field:=4, _
Criteria1:="< & KG_Test", Operator:=xlAnd
Range("A1").Select
End Sub
'
'
Thanks,
KG
I've read through the posts yet I cannot see what I am doing wrong....spent hours before posting.
I have a variable that I want to use in an auto filter. I've stripped the code to the barest minimum and still - no go. It is needed for use with a user form through wich the variable will be set by the ControlSource of a drop down list. But I can't get even the simplest code to work. All contributions are really appreciated. (The variable KG_Test is getting the proper number - I've also tried defining the variable with different data types (Long, Integer etc.)
'
'
Sub Human()
'
' Attempt to use a variable within an autofilter
'
KG_Test = Range("Input")
'
On Error Resume Next
ActiveSheet.ShowAllData
'
Range("D").Select
ActiveSheet.Range("db_Timesheet").AutoFilter Field:=4, _
Criteria1:="< & KG_Test", Operator:=xlAnd
Range("A1").Select
End Sub
'
'
Thanks,
KG