Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA variable name in autofilter criteria 1

Status
Not open for further replies.

Hcleslie

MIS
Feb 27, 2005
11
US
I have a string variable Manager_Val that I would like to use in autofilter criteria

.Range("A1").AutoFilter Field:=2, Criteria1:="<>(Manager_Val)"

When I run the macro I am getting the actual name “Manager_Val”, instead of the value of the variable.

How do I refer to the variable Manager_Val for criteria1?

Thanks
 
Hi.
Code:
.Range("A1").AutoFilter Field:=2, Criteria1:="<>" & [Manager_Val]


Skip,
[sub]
[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue][/sub]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top