relative destination for advance filter results

D

davechev

I have the following macro to perform a filter. I would like to substitute
the cell
address contained in cell "G1" (which changes) for the destination address,
which
is now "G3".

Range("g3:k3500").Select
Selection.ClearContents
Range("G1").Select
Sheets("CVO data").Range("H1:L3000").AdvancedFilter
Action:=xlFilterCopy, _
CriteriaRange:=Range("I1:I2"), CopyToRange:=Range("G3"), Unique:=True


Can this be done?
 
R

Rik_UK

Do you mean that the destination cell you want to copy the filtered results
to is the content of cell G1? I so:

.... CopyToRange:=Range(Range("G1").Text), ...

If this is the answer please remember to click the button below...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

CopyToRange to include hyperlink 0
Filter and copy question 3
Advance Filter Format 0
macro add 10
xlfiltercopy and formatting 0
advanced filter office 2007 3
Advance Filter data to store array 0
Adjust macro 0

Top