Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jln jln is offline
external usenet poster
 
Posts: 2
Default Trying to creat a Macro to count rows and more

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Trying to creat a Macro to count rows and more

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   Report Post  
Posted to microsoft.public.excel.programming
jln jln is offline
external usenet poster
 
Posts: 2
Default Trying to creat a Macro to count rows and more

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trying to creat a Macro to count rows and more

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Trying to creat a Macro to count rows and more

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
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
Pls help for creat a Macro.... John Excel Discussion (Misc queries) 4 January 31st 08 08:29 PM
How do I creat a macro to delete the first 20 cell characters Bobo-ack Excel Worksheet Functions 5 April 20th 07 03:00 AM
Count Rows macro MikeD1224 Excel Discussion (Misc queries) 3 February 19th 07 08:49 PM
Macro to Count Rows anonymous Excel Programming 2 July 1st 05 11:56 PM
creat a macro to look for a file Kelly****** Excel Discussion (Misc queries) 1 January 2nd 05 09:24 AM


All times are GMT +1. The time now is 03:55 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"