Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Take Action Based Upon # of Rows in Another Worksheet

Have been trying to figure out how to do this. I have 2 worksheets, A and B.
Need to copy row 3 on worksheet B and paste it down as many rows as there
are on worksheet A. Example, if the last row of data on A is in row 4500,
then I need to copy Row 3 on B and paste it from row 4 through 4500 of
worksheet B. The # of rows on A will change each time. I know how to do all
the copy/paste stuff, but am stuck on how to direct VB on how many rows to
paste down. Would appreciate help very much on this.....thanks.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Take Action Based Upon # of Rows in Another Worksheet

lastrow = Worksheets("A").Cells(rows.count,1).End(xlup).row
worksheets("B").Rows(3).copy Destination:= _
Worksheets("A").Range("A4").Resize(lastrow-3).EntireRow

--
Regards,
Tom Ogilvy


"Paige" wrote:

Have been trying to figure out how to do this. I have 2 worksheets, A and B.
Need to copy row 3 on worksheet B and paste it down as many rows as there
are on worksheet A. Example, if the last row of data on A is in row 4500,
then I need to copy Row 3 on B and paste it from row 4 through 4500 of
worksheet B. The # of rows on A will change each time. I know how to do all
the copy/paste stuff, but am stuck on how to direct VB on how many rows to
paste down. Would appreciate help very much on this.....thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Take Action Based Upon # of Rows in Another Worksheet

Thanks Don and Tom; they both work great!

"Tom Ogilvy" wrote:

lastrow = Worksheets("A").Cells(rows.count,1).End(xlup).row
worksheets("B").Rows(3).copy Destination:= _
Worksheets("A").Range("A4").Resize(lastrow-3).EntireRow

--
Regards,
Tom Ogilvy


"Paige" wrote:

Have been trying to figure out how to do this. I have 2 worksheets, A and B.
Need to copy row 3 on worksheet B and paste it down as many rows as there
are on worksheet A. Example, if the last row of data on A is in row 4500,
then I need to copy Row 3 on B and paste it from row 4 through 4500 of
worksheet B. The # of rows on A will change each time. I know how to do all
the copy/paste stuff, but am stuck on how to direct VB on how many rows to
paste down. Would appreciate help very much on this.....thanks.

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
Extracting specific rows out of one worksheet based on an identifi Patrick Excel Discussion (Misc queries) 1 March 31st 09 04:23 PM
Insert Rows Based on values in another worksheet Jason Excel Discussion (Misc queries) 3 June 24th 07 01:13 PM
Cutting Rows from one Worksheet to another based on a value Edwyn Excel Discussion (Misc queries) 0 October 20th 06 12:11 PM
Worksheet Parsing of Rows Based Upon Column Value [email protected] Excel Programming 2 September 22nd 05 09:47 PM
searching for specific criteria and then doing an action based on Bill Excel Discussion (Misc queries) 1 July 20th 05 03:55 AM


All times are GMT +1. The time now is 04:10 AM.

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"