Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying nothing/everything when an autofilter returns no results? XL2003 | Excel Programming | |||
Terminating autofilter removes commandbuttons (xl2000, not in xl2003) | Excel Programming | |||
Copying, Pasting Autofilter results to a region more specific than a specified worksheet. | Excel Programming | |||
Switch off Sort with Autofilter in XL2003 | Excel Programming | |||
Exclude Header from Range? | Excel Discussion (Misc queries) |