Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Um trying to create a macro that counts all the rows on one sheet in say 5
rows abcde then go to the last record before a null or blank cell then takes thoses five records and copys and paste them over to another worksheet. I then want the Macro to go to another worksheet and do the same as above but it needs to paste thoses records onto the same worksheet as above but below the already pasted records. The number of lines could change as well that will need to be pasted. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim sh as Worksheet
for each sh in worksheets(Array(1,3,5,8,9)) sh.Range("A1").currentregion.copy _ worksheets(4).Cells(rows.count,1).End(xlup)(2) Next -- Regards, Tom Ogilvy "jln" wrote: Um trying to create a macro that counts all the rows on one sheet in say 5 rows abcde then go to the last record before a null or blank cell then takes thoses five records and copys and paste them over to another worksheet. I then want the Macro to go to another worksheet and do the same as above but it needs to paste thoses records onto the same worksheet as above but below the already pasted records. The number of lines could change as well that will need to be pasted. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think this is close but I not sure about the array im only going to be
going from on sheet then copy then going to another sheet and copy. Tom Ogilvy wrote: Dim sh as Worksheet for each sh in worksheets(Array(1,3,5,8,9)) sh.Range("A1").currentregion.copy _ worksheets(4).Cells(rows.count,1).End(xlup)(2) Next Um trying to create a macro that counts all the rows on one sheet in say 5 rows abcde then go to the last record before a null or blank cell then takes [quoted text clipped - 3 lines] the already pasted records. The number of lines could change as well that will need to be pasted. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
that is what it is doing
if we had this: for each sh in worksheets(Array(1,3)) It would go to the first sheet in the tab order and copy paste to sheet 4 in the tab order at the top then it would go to the third sheet in the tab order and copy paste to sheet 4 in the tab order below the first. Assumes that the first column that was pasted will not have blank cells at the bottom -- Regards, Tom Ogilvy "jln" <u25956@uwe wrote in message news:658c0d5600c4f@uwe... I think this is close but I not sure about the array im only going to be going from on sheet then copy then going to another sheet and copy. Tom Ogilvy wrote: Dim sh as Worksheet for each sh in worksheets(Array(1,3,5,8,9)) sh.Range("A1").currentregion.copy _ worksheets(4).Cells(rows.count,1).End(xlup)(2) Next Um trying to create a macro that counts all the rows on one sheet in say 5 rows abcde then go to the last record before a null or blank cell then takes [quoted text clipped - 3 lines] the already pasted records. The number of lines could change as well that will need to be pasted. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for Your Help Tom
I tried your code with my worksheet names and im not having any luck. All I should have to do to make this work with names is replace the numbers right? I get and expected seprator or ) when i change to the names im using for my tabs. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200609/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pls help for creat a Macro.... | Excel Discussion (Misc queries) | |||
How do I creat a macro to delete the first 20 cell characters | Excel Worksheet Functions | |||
Count Rows macro | Excel Discussion (Misc queries) | |||
Macro to Count Rows | Excel Programming | |||
creat a macro to look for a file | Excel Discussion (Misc queries) |