Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default how to paste to last row in another sheet

dear all,
i manage to create header(from header sheet) and details(from detail
sheet) data and paste in final sheet. i face the problem of putting
the last row which is the trailer of the record from trailer sheet.
all i use macro to do it. in the copy and paste what function to use
in macro to identify which is the row immediately after the last
detail row. please help and thanks alot.

1 header
6 detail line
1 trailer
all the below populate in same column which is A


142130091000100Merseng Khung 16102004 (header)
142130091000188112189001123730000005000D.S KRISA A/P D.
142130091000188154022000051140000012025DAVID ANAK PALIT
142130091000188162184000303910000009500ELLY MARINA SAERDG
1421300910001881111111111 0000009900THIS IS TESTING
14213009100018822222222 0000004500THIS IS 2ND
14213009100018833333333 0000034500THIS IS 3RD
HOW TO KNOW THIS IS THE TRAILER (trailer)

yes, first character is number for all 3 components.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default how to paste to last row in another sheet

This will return 7 in your example:

lngLastRow = Sheets("Final").Cells(Rows.Count, 1).End(xlUp).Row


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"tango" wrote in message
om...
dear all,
i manage to create header(from header sheet) and details(from detail
sheet) data and paste in final sheet. i face the problem of putting
the last row which is the trailer of the record from trailer sheet.
all i use macro to do it. in the copy and paste what function to use
in macro to identify which is the row immediately after the last
detail row. please help and thanks alot.

1 header
6 detail line
1 trailer
all the below populate in same column which is A


142130091000100Merseng Khung 16102004 (header)
142130091000188112189001123730000005000D.S KRISA A/P D.
142130091000188154022000051140000012025DAVID ANAK PALIT
142130091000188162184000303910000009500ELLY MARINA SAERDG
1421300910001881111111111 0000009900THIS IS TESTING
14213009100018822222222 0000004500THIS IS 2ND
14213009100018833333333 0000034500THIS IS 3RD
HOW TO KNOW THIS IS THE TRAILER (trailer)

yes, first character is number for all 3 components.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default how to paste to last row in another sheet

Rob van Gelder wrote:
This will return 7 in your example:

lngLastRow = Sheets("Final").Cells(Rows.Count, 1).End(xlUp).Row


This is the often-suggested, perhaps the most often-suggested, solution;
it is even embodied in purportedly general purpose code at the web site
of Frank Kabel and Bob Phillips. It works for *almost* all cases, but
fails if the last row of the worksheet contains data, probably a rare
occurrence.

Alan Beban
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default how to paste to last row in another sheet

Frank and Bob have web sites?


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Alan Beban" wrote in message
...
Rob van Gelder wrote:
This will return 7 in your example:

lngLastRow = Sheets("Final").Cells(Rows.Count, 1).End(xlUp).Row


This is the often-suggested, perhaps the most often-suggested, solution;
it is even embodied in purportedly general purpose code at the web site of
Frank Kabel and Bob Phillips. It works for *almost* all cases, but fails
if the last row of the worksheet contains data, probably a rare
occurrence.

Alan Beban



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to paste to last row in another sheet

One combined site:

http://www.xldynamic.com/source/xld.Rounding.html#vba

as an example or just

http://www.xldynamic.com

--
Regards,
Tom Ogilvy


"Rob van Gelder" wrote in message
...
Frank and Bob have web sites?


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Alan Beban" wrote in message
...
Rob van Gelder wrote:
This will return 7 in your example:

lngLastRow = Sheets("Final").Cells(Rows.Count, 1).End(xlUp).Row


This is the often-suggested, perhaps the most often-suggested, solution;
it is even embodied in purportedly general purpose code at the web site

of
Frank Kabel and Bob Phillips. It works for *almost* all cases, but fails
if the last row of the worksheet contains data, probably a rare
occurrence.

Alan Beban







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default how to paste to last row in another sheet

Thanks.

I had been there but never knew who it belonged to.

Cheers

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Tom Ogilvy" wrote in message
...
One combined site:

http://www.xldynamic.com/source/xld.Rounding.html#vba

as an example or just

http://www.xldynamic.com

--
Regards,
Tom Ogilvy


"Rob van Gelder" wrote in message
...
Frank and Bob have web sites?


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Alan Beban" wrote in message
...
Rob van Gelder wrote:
This will return 7 in your example:

lngLastRow = Sheets("Final").Cells(Rows.Count, 1).End(xlUp).Row


This is the often-suggested, perhaps the most often-suggested,
solution;
it is even embodied in purportedly general purpose code at the web site

of
Frank Kabel and Bob Phillips. It works for *almost* all cases, but
fails
if the last row of the worksheet contains data, probably a rare
occurrence.

Alan Beban







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
How to automatically paste cells from one sheet to another sheet? Jenni Excel Discussion (Misc queries) 1 March 24th 10 11:16 PM
Alternate Row Select in Sheet 1 then Paste to Sheet 2 Steevo Excel Worksheet Functions 4 December 5th 08 06:45 PM
Copy from one Sheet and paste on another sheet based on condition Prem Excel Discussion (Misc queries) 2 December 24th 07 05:05 AM
Active Cell Copy And Paste Sheet to Sheet A.R.J Allan Jefferys New Users to Excel 4 May 4th 06 02:04 AM
Paste a sheet as a link Yakimo Excel Programming 3 January 3rd 04 06:43 PM


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