Copying Autofiltered cells

B

Brad

Hi All,

This I'm sure is easy to do, however I've come to a dead end...

My sheet has a bunch of cost data in it with the totals of each column shown
in the first 3 rows. I also have a header row on row 4 which is
autofiltered. My totals change dependant on what is autofiltered. What I'm
trying to do is copy everything that is visible when an autofilter is in
place, then paste it on another sheet. Unfortunately
..SpecialCells(xlCellTypeVisible).Copy only selects the autofiltered cells,
and header row. I need something that will also copy the totals I have in
the first 3 rows.

I understand that selection.copy will do what I want, but it grabs the whole
sheet, and is time consuming.

Thanks for your help.

BC
 
T

Tom Ogilvy

Try this:

Sub BB()
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
rng.Resize(rng.Rows.Count + 3).Copy _
Destination:=Worksheets("Sheet3").Range("A1")

End Sub

It works for me.
 

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

Top