Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi to all
I've did a CF like the example below Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="=*WARNING*", Operator:=xlAnd Selection.AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd Is possible change the criteria withoult change the macro e.g insert the criteria word in a cell P1 . Appreciate any help CC |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Something like this:
Selection.AutoFilter Field:=3, Criteria1:="=*" & Range("P1")Value & "*" -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "CC" wrote: Hi to all I've did a CF like the example below Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="=*WARNING*", Operator:=xlAnd Selection.AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd Is possible change the criteria withoult change the macro e.g insert the criteria word in a cell P1 . Appreciate any help CC |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Not 100% sure what you want here. Did you want the filter to change when
someone changes the value in Cell P1? You r current filter has 2 criteria. Which on eis this??? -- HTH... Jim Thomlinson "CC" wrote: Hi to all I've did a CF like the example below Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="=*WARNING*", Operator:=xlAnd Selection.AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd Is possible change the criteria withoult change the macro e.g insert the criteria word in a cell P1 . Appreciate any help CC |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You need to have Worksheet change event code to re-apply the filter when cell P1 changes, and change
the code from Criteria1:="=*WARNING*" to Criteria1:="=*" & Worksheet("SName").Range("P1").VAlue * "*" HTH, Bernie MS Excel MVP "CC" wrote in message ... Hi to all I've did a CF like the example below Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="=*WARNING*", Operator:=xlAnd Selection.AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd Is possible change the criteria withoult change the macro e.g insert the criteria word in a cell P1 . Appreciate any help CC |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Both
"Jim Thomlinson" wrote: Not 100% sure what you want here. Did you want the filter to change when someone changes the value in Cell P1? You r current filter has 2 criteria. Which on eis this??? -- HTH... Jim Thomlinson "CC" wrote: Hi to all I've did a CF like the example below Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="=*WARNING*", Operator:=xlAnd Selection.AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd Is possible change the criteria withoult change the macro e.g insert the criteria word in a cell P1 . Appreciate any help CC |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here is some code that might do the trick. I do not know which range you want
filtered so this is the best I can give you for now... Private Sub Worksheet_Change(ByVal Target As Range) if target.address = "$P$1" then with Range("A1:N10000") .AutoFilter .AutoFilter Field:=3, Criteria1:="=*" & .range("P1").value & "*", Operator:=xlAnd .AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd end with end if end sub This code needs to be placed in the worksheet. Right click the sheet tab and select view code. Paste the code in there... -- HTH... Jim Thomlinson "CC" wrote: Both "Jim Thomlinson" wrote: Not 100% sure what you want here. Did you want the filter to change when someone changes the value in Cell P1? You r current filter has 2 criteria. Which on eis this??? -- HTH... Jim Thomlinson "CC" wrote: Hi to all I've did a CF like the example below Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="=*WARNING*", Operator:=xlAnd Selection.AutoFilter Field:=9, Criteria1:="=*Pressure*", Operator:=xlAnd Is possible change the criteria withoult change the macro e.g insert the criteria word in a cell P1 . Appreciate any help CC |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change Row Colour if certain criteria is met | Excel Worksheet Functions | |||
auto set time(now) if criteria=true with no later change | Excel Worksheet Functions | |||
Change text based on other cell criteria? | Excel Worksheet Functions | |||
Based on one cell criteria to change the rest of that row to a col | Excel Discussion (Misc queries) | |||
how do I change the font of a cell if it meets a certain criteria. | Excel Worksheet Functions |