Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering & copying

Status
Not open for further replies.

max1565

Technical User
Dec 16, 2002
57
US
I have a spread sheet (worksheet "work") that covers range("a1:x65000"). I am trying to use autofilter and copy a specific column to another sheet. Say i am copying the data in column a on worksheet("work") to the next empty cell in column b on worksheets("sample").

I can't figure out how to select the range of filtered data on column a on worksheet work.

thanks
 
Try something like this (after filtering the data):
WorkSheets("work").Range("A:A").Copy _
Destination:=WorkSheets("sample").Cells(65536,2).End(xlUp)


Hope This Help
PH.
 
You don't have to select filtered data - as PHV's code indicates, you can select the ENTIRE range as the copy will only take those cells that are not filtered out...

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
I dunno if it's just me but if you copy the whole column and try to paste it below row 1 elsewhere it won't fit. The problem is that all the visible cells are copied (generally what's needed) but this also includes the cells below the filtered area.

You could try working with used ranges etc but this amendment to PHV's code should do the trick. Note also the addition of Offset to the destination range

Code:
Worksheets("Work").Range(Cells(1, 1), Cells(65536, 1).End(xlUp)).Copy _
Destination:=Worksheets("Sample").Range("B65536").End(xlUp).Offset(1, 0)

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top