Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to filter some data based on a specific field. However, I need to copy
only the last 12 rows of the filtered data and paste it on another worksheet. I know how to do all of this in VB except for determining how to only capture the last 12 rows of the filtered data. I tried getting the last column of data and setting the copy range from [(last row - 12) to last row] but this gets the hidden and visible rows instead of 12 of the visible rows. For ex. lets assume the filtered data is on rows 1,5,10,15,16,24,28,35,40,42,60,72, 75,80. I only need the last 12 so I need rows 10 ... 80. If I use (last row-12) then it "copies" rows 68 - 80 but really only captures the data on rows 72 and 80 since the other data between rows 68 and 80 are hidden. How can I accomplish this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Get the last row of the destination sheet before you copy to it, then
get it again after you've copied to it to determine how many rows were copied, then delete all but the last 12 in the destination sheet. Charles RW wrote: I need to filter some data based on a specific field. However, I need to copy only the last 12 rows of the filtered data and paste it on another worksheet. I know how to do all of this in VB except for determining how to only capture the last 12 rows of the filtered data. I tried getting the last column of data and setting the copy range from [(last row - 12) to last row] but this gets the hidden and visible rows instead of 12 of the visible rows. For ex. lets assume the filtered data is on rows 1,5,10,15,16,24,28,35,40,42,60,72, 75,80. I only need the last 12 so I need rows 10 ... 80. If I use (last row-12) then it "copies" rows 68 - 80 but really only captures the data on rows 72 and 80 since the other data between rows 68 and 80 are hidden. How can I accomplish this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This may be a good approach to my problem. Thanks
"Die_Another_Day" wrote: Get the last row of the destination sheet before you copy to it, then get it again after you've copied to it to determine how many rows were copied, then delete all but the last 12 in the destination sheet. Charles RW wrote: I need to filter some data based on a specific field. However, I need to copy only the last 12 rows of the filtered data and paste it on another worksheet. I know how to do all of this in VB except for determining how to only capture the last 12 rows of the filtered data. I tried getting the last column of data and setting the copy range from [(last row - 12) to last row] but this gets the hidden and visible rows instead of 12 of the visible rows. For ex. lets assume the filtered data is on rows 1,5,10,15,16,24,28,35,40,42,60,72, 75,80. I only need the last 12 so I need rows 10 ... 80. If I use (last row-12) then it "copies" rows 68 - 80 but really only captures the data on rows 72 and 80 since the other data between rows 68 and 80 are hidden. How can I accomplish this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting or filtering for rows | Excel Discussion (Misc queries) | |||
How do I Copy and Paste onto Same Rows after filtering out rows. | Excel Discussion (Misc queries) | |||
Filtering Rows ? | Excel Worksheet Functions | |||
copy and paste after filtering | Excel Discussion (Misc queries) | |||
Filtering rows with tracked changes | Excel Discussion (Misc queries) |