LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Exclude header row when copying autofilter results? (XL2003)

I'm looping through code that updates an autofilter, and then I copy the
autofiltered data to a target sheet (hundreds of times). The problem is that
it is also copying the header row, and as I add each chunk of data to my
destination sheets, I've got unwanted repeating header rows throughout the
data.

Is there a good way to select the autofiltered rows while excluding just the
header row? When I record my desired activity via macro, is selects the first
row, which will vary depending on what data I'm autofiltering on in each loop.

Current code:
Sheet2.Activate
Sheet2.Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:=SortableTempVal
Sheet2.Cells.Select
Selection.Copy

Recorded macro selecting the visible rows excluding the header row:
Rows("752:752").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

If there isn't a good way, I suppose I can write some less elegant code to
delete the first pasted row in each destination worksheet, but I was hoping
to learn something new today :)

Thanks!
Keith
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying nothing/everything when an autofilter returns no results? XL2003 ker_01 Excel Programming 1 October 23rd 08 10:47 PM
Terminating autofilter removes commandbuttons (xl2000, not in xl2003) Rob[_5_] Excel Programming 3 August 29th 07 08:07 PM
Copying, Pasting Autofilter results to a region more specific than a specified worksheet. [email protected] Excel Programming 1 March 28th 07 06:16 PM
Switch off Sort with Autofilter in XL2003 Roger Govier Excel Programming 5 December 4th 06 10:02 PM
Exclude Header from Range? nastech Excel Discussion (Misc queries) 4 December 30th 05 02:49 PM


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"