LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Copy Last Row and Paste as last record

Or, a bit more efficiently:

Const csFILEPATH As String = _
"S:\Stardex Compliance\Registers\Stardex Breach Register.xls"
Dim rSource As Range

With ActiveWorkbook.Worksheets("Register")
Set rSource = .Cells(.Rows.Count, 1).End(xlUp)
End With
With Workbooks.Open(csFILEPATH)
With .Sheets("Register")
rSource.EntireRow.Copy _
Destination:=.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
End With
.Close SaveChanges:=True
End With

In article ,
JE McGimpsey wrote:

One way:

Const csFILEPATH As String = _
"S:\Stardex Compliance\Registers\Stardex Breach Register.xls"
Dim wbDest As Workbook
Dim rDest As Range
Dim rSource As Range

With ActiveWorkbook.Worksheets("Register")
Set rSource = .Cells(.Rows.Count, 1).End(xlUp)
End With
Set wbDest = Workbooks.Open(csFILEPATH)
With wbDest.Sheets("Register")
rSource.EntireRow.Copy _
Destination:=.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
End With
wbDest.Close SaveChanges:=True

 
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
cut and paste specific record on same worksheet violet Excel Programming 8 September 29th 06 01:02 PM
ExcelVBA Paste record In next empty next Row [email protected] Excel Programming 2 February 21st 06 07:05 PM
Copy and paste from last record at bottom of column [email protected] New Users to Excel 0 February 7th 06 10:25 PM
record macro - copy absolute, paste relative Bill Carr Excel Programming 0 October 27th 04 10:41 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM


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