#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default paste issue

i would like to copy one list in a worksheet A to worksheet B but sheet B has
title rows of data starting in row 2 which cant be overwritten. If column A
has data in itit needs to paste below it. worksheet A is a list with no
breaks. so if sheet B has data, 7row breaks, data, 3 row break... it needs
to sopy the first 7 (of sheet A) of the list starting to paste at row 2 in
sheet B, then recognise the gap required and paste the next 3 below it (row
10).

any help?

cheers.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default paste issue

set ShtA = sheets("Sheet1")
set ShtB = sheets("Sheet2")

'start at A1 and look down until last data cell is found
LastRow = ShtA.Range("A1").end(xldown).Row
Set CopyRows = Rows("1:" & LastRow)

'go to last row of worksheet and move up until data is found
LastRow = ShtB.Range("A" & Rows.Count).end(xlup).Row
NewRow = LastRow + 3

CopyRows.Copy _
Destination:=ShtB.Rows(NewRow)



"project manager" wrote:

i would like to copy one list in a worksheet A to worksheet B but sheet B has
title rows of data starting in row 2 which cant be overwritten. If column A
has data in itit needs to paste below it. worksheet A is a list with no
breaks. so if sheet B has data, 7row breaks, data, 3 row break... it needs
to sopy the first 7 (of sheet A) of the list starting to paste at row 2 in
sheet B, then recognise the gap required and paste the next 3 below it (row
10).

any help?

cheers.

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
Date Cut & Paste Issue Sweepea Excel Discussion (Misc queries) 8 October 28th 09 07:20 PM
Paste issue Victoria Excel Discussion (Misc queries) 0 November 24th 08 01:23 AM
Copy & Paste Issue carrera0000 Excel Discussion (Misc queries) 3 August 17th 07 02:24 AM
Copy Paste issue amwebber Excel Worksheet Functions 3 October 31st 06 02:08 AM
Simple Paste Issue Shai Shefer Excel Programming 3 August 29th 06 10:34 PM


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"