ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Autofilter multiple columns (https://www.excelbanter.com/excel-worksheet-functions/126467-autofilter-multiple-columns.html)

Saintsman

Autofilter multiple columns
 
I need to filter 2 columns (from about 30) using VBA
Select Client (drop down box) &/or Select Contractor (drop down box)

I can select on either one using
Range("client").Select
Selection.AutoFilter Field:=1, Criteria1:="*" & Range("$J$4") & "*"

but how do I select for combined Client 1 & Contractor A
We have an issue with either multi client or multi contractors on same
project
hence wildcard. I have tried:
Range("contractor").Select
Selection.AutoFilter Field:=1, Criteria1:="*" & Range("$j$2") & "*",
Operator:=xlAnd
Range("client").Select etc - but no luck

arno

Autofilter multiple columns
 
Hi Saintsman,

add one dummy column where you combine criteria 1 and 2 to one singel
criteria.

arno


Saintsman

Autofilter multiple columns
 
arno
thanks for the effort - not really what I wanted to do
managed to solve immediate issue


"arno" wrote:

Hi Saintsman,

add one dummy column where you combine criteria 1 and 2 to one singel
criteria.

arno




All times are GMT +1. The time now is 03:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com