I am trying to use advanced filter function for a relative range that will change everyday.
does anyone know how to do it?
Thanks,
Yasar
I am trying to use advanced filter function for a relative range that will change everyday.
does anyone know how to do it?
Thanks,
Yasar
how does it change every day? Can you use a named range, it will not chnage if rows are deleted etc.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
there will be new rows added to it,Originally Posted by lucas
Here is the code I am using
Range("G1:G12491").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Workbooks("test.xls").Sheets("Sheet2").Range("A1:A5"), _
Unique:=False
and the range tomorrow might be ("G1:G13000")
With other functions I can write "selection" at the beginning of the code and it will work like sort, function, but with this I could not manage it so far.
Have you tried:
[VBA]
Range("G:G").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Workbooks("test.xls").Sheets("Sheet2").Range("A1:A5"), _
Unique:=False
[/VBA]
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
this seems to work with a selection but I don't have your data so untested also:
[VBA]With Selection
.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Workbooks("test.xls").Sheets("Sheet2").Range("A1:A5"), _
Unique:=False
End With[/VBA]
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
thank you very much, that saved the dayOriginally Posted by lucas
Last edited by yasarayhanka; 08-29-2007 at 11:09 AM.