LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default VBA to Filter on variable column


Hi Claus

OK that's perfect.

Thanks for your time and considerable expertise.



Best Wishes


Colin






In article , Claus Busch
writes
Hi again,

Am Tue, 27 May 2014 16:14:24 +0200 schrieb Claus Busch:

.UsedRange.AutoFilter Field:=Columns(myArr(0)).Column, _
Criteria1:=IIf(myArr(2) = 0, Trim(myArr(1)), _
"*" & Trim(myArr(1)) & "*")


better change the lines above to:

.UsedRange.AutoFilter Field:=Columns(myArr(0)).Column, _
Criteria1:=IIf(UBound(myArr) = 1, Trim(myArr(1)), _
"*" & Trim(myArr(1)) & "*")

If you want filter for the exact value only enter the column letter and
the value. If you want filter for substring enter the third value e.g. 0
For exact value
C,LP
for substring
C,LP,0


Regards
Claus B.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
use a range variable in advanced filter Jake Excel Programming 4 January 4th 08 09:19 PM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM
how do I filter for 1 variable in multiple columns California Excel Worksheet Functions 1 March 18th 05 10:36 PM
Variable as argument in filter range Bert[_2_] Excel Programming 3 January 21st 05 10:41 PM
Auto Filter and Criteria1 variable D.S.[_3_] Excel Programming 2 November 18th 03 04:16 AM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"