Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello again Michael,
Another thing you should do when using Advanced filter with code is to clear the old extracted data before re-running the code. If you don't do this before you re-run the code and there are actually less elements in the extracted data there was previously then you will still have extra data at the bottom of the list from the previous run. Because Excel creates a Defined name "Extract" for the position of the column header of the extracted range, you can use it to identify the range to be cleared. Example: (Insert immediately before the advanced filter code line) Range("Extract", Range("Extract").End(xlDown)).ClearContents Note: You cannot insert that line in your code until after the advanced filter has been run at least once. -- Regards, OssieMac |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
assign variable to a range | Excel Programming | |||
Assign copied range to a variable | Excel Programming | |||
VBA Excel how to assign name in variable range | Excel Programming | |||
range variable won't assign (chartobject.topleftcell property) | Excel Programming | |||
How to assign a variable in a range select | Excel Programming |