View Full Version : Autofilter Field
bradh_nz
07-30-2007, 07:51 AM
Is it possible to make the below criteria for a filter dynamic by making:
This
Selection.AutoFilter Field:=17
Becoming
Selection.AutoFilter Field:="The Column Name"
Thanks
Brad
You can use something like:
selection.autofilter field:=application.match("column name", selection.rows(1), 0)
Regards,
Rory
bradh_nz
07-30-2007, 08:11 AM
Fantastic, thanks
No problem. It's probably safer, unless you can guarantee the column name exists, to store the result of the Application.Match in a variant variable and check it using IsError just to be sure there was a match.
Regards,
Rory
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.