ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying Autofiltered cells (https://www.excelbanter.com/excel-programming/355118-copying-autofiltered-cells.html)

Brad[_22_]

Copying Autofiltered cells
 
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




davesexcel[_37_]

Copying Autofiltered cells
 

http://www.contextures.com/xladvfilter01.html

Check this site out maybe you can get it to work


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=519058


Tom Ogilvy

Copying Autofiltered cells
 
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.

--
Regards,
Tom Ogilvy


"Brad" wrote in message
...
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







All times are GMT +1. The time now is 07:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com