Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias like this
Hi
Range("E4:AI183").Select Selection.AutoFilter Field:=1, Criteria1:=Leverandor, VisibleDropDown:=False Selection.AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False It works without the third line. I'm getting an error (1004) on the third line. Regards, Claus |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias
Range("E4:AI183").Select
Selection.AutoFilter Field:=1, Criteria1:=Leverandor Selection.AutoFilter Field:=35, Criteria1:="<" be sure that the word Leverandor is a string variable with a value or wrap it in quotes -- "Leverandor" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias like this
Claus
use the following code: with Range("E4:AI183"). .AutoFilter Field:=1, Criteria1:=Leverandor, VisibleDropDown:=False .AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False end with DM Unseen |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias
Hi Patrick
Leverandor is a string with a value. Thesecond line works fine alone Claus "Patrick Molloy" skrev i en meddelelse ... Range("E4:AI183").Select Selection.AutoFilter Field:=1, Criteria1:=Leverandor Selection.AutoFilter Field:=35, Criteria1:="<" be sure that the word Leverandor is a string variable with a value or wrap it in quotes -- "Leverandor" |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias like this
It works
Thank you "DM Unseen" skrev i en meddelelse ups.com... Claus use the following code: with Range("E4:AI183"). .AutoFilter Field:=1, Criteria1:=Leverandor, VisibleDropDown:=False .AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False end with DM Unseen |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias like this
Is there a way to check if the 2 crits. results in no rows ?
Leverandor contains Companys and field 35 is the amount to be delivered. Some Companys have no amount. I don't want to print these. Claus "Claus" skrev i en meddelelse ... It works Thank you "DM Unseen" skrev i en meddelelse ups.com... Claus use the following code: with Range("E4:AI183"). .AutoFilter Field:=1, Criteria1:=Leverandor, VisibleDropDown:=False .AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False end with DM Unseen |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias like this
Dim bNoVisibleLines as boolean
with Range("E4:AI183"). .AutoFilter Field:=1, Criteria1:=Leverandor, VisibleDropDown:=False .AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False bNoVisibleLines = (.SpecialCells(xlCellTypeVisible).Rows.Count = 1) ' only header ro shows end with Dm Unseen |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why can't i filter two different columns with different criterias like this
Hi Unseen
I got i working, but: bNoVisibleLines is always true when Count = 1, always false when count = 0 NumberOfVisibleLines is always x 5 of visible lines - 1 visible line = 5, 2 =10 an so on. Why is NumberOfVisibleLines always = visiblerows * 5 ? Dim bNoVisibleLines As Boolean, NumberOfVisibleLines As Integer For y = 0 To AntalGyldigeLev - 1 Leverandor = Lev(y, 1) bNoVisibleLines = False NumberOfVisibleLines = 0 With Range("A4:AI183") .AutoFilter Field:=5, Criteria1:=Leverandor, VisibleDropDown:=False .AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False bNoVisibleLines = (.SpecialCells(xlCellTypeVisible).Rows.Count = 1) NumberOfVisibleLines = .Rows.SpecialCells(xlCellTypeVisible).Count End With MsgBox Leverandor & ", " & NumberOfVisibleLines & " synlige linie(r)", , bNoVisibleLines If y NumberOfVisibleLines 5 Then 'Call UdSkriv("Ordrebekræftigelse", Leverandor, "C", "D", "E", "F") End If Next y "DM Unseen" skrev i en meddelelse oups.com... Dim bNoVisibleLines as boolean with Range("E4:AI183"). .AutoFilter Field:=1, Criteria1:=Leverandor, VisibleDropDown:=False .AutoFilter Field:=35, Criteria1:="<", VisibleDropDown:=False bNoVisibleLines = (.SpecialCells(xlCellTypeVisible).Rows.Count = 1) ' only header ro shows end with Dm Unseen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do sum a column only if meets the criterias of 2 columns | Excel Discussion (Misc queries) | |||
Filter data with two criterias | Excel Discussion (Misc queries) | |||
Need function for one value for two criterias and two columns | Excel Worksheet Functions | |||
how to return the value of a cell based on two criterias in two columns | Excel Programming | |||
how to return the value of a cell based on two criterias in two columns | Excel Programming |