ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy & Paste+Offset (https://www.excelbanter.com/excel-programming/309162-copy-paste-offset.html)

Ronald Cayne

Copy & Paste+Offset
 
Want to copy data in Sheet1 a1:j1 Copy and paste Values
to Sheet 2 A1:j1


When Macro is rerun 1 want to copy the data Sheet1:a1:j1
to Sheet 2!a2:j2(Values only)

Each time I want to add the data from line 1 sheet 1 to the next
unoccupied line in Sheet 2

Ron


Norman Jones

Copy & Paste+Offset
 
Hi Ronald,

Try:

Sub Tester()
Dim Rng As Range
Application.ScreenUpdating = False
With Sheets("Sheet2")
If Not IsEmpty(.Range("A1")) Then
Set Rng = .Cells(Rows.Count, 1).End(xlUp)(2)
Else
Set Rng = .Range("A1")
End If
End With

Sheets("Sheet1").Range("A1:J1").Copy
Rng.PasteSpecial Paste:=xlValues

With Application
.CutCopyMode = False
.ScreenUpdating = False
End With
End Sub


---
Regards,
Norman



"Ronald Cayne" wrote in message
...
Want to copy data in Sheet1 a1:j1 Copy and paste Values
to Sheet 2 A1:j1


When Macro is rerun 1 want to copy the data Sheet1:a1:j1
to Sheet 2!a2:j2(Values only)

Each time I want to add the data from line 1 sheet 1 to the next
unoccupied line in Sheet 2

Ron




Norman Jones

Copy & Paste+Offset
 
Hi Ronald,

The ante-penultimate line

.ScreenUpdating = False


should read

.ScreenUpdating = True

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Ronald,

Try:

Sub Tester()
Dim Rng As Range
Application.ScreenUpdating = False
With Sheets("Sheet2")
If Not IsEmpty(.Range("A1")) Then
Set Rng = .Cells(Rows.Count, 1).End(xlUp)(2)
Else
Set Rng = .Range("A1")
End If
End With

Sheets("Sheet1").Range("A1:J1").Copy
Rng.PasteSpecial Paste:=xlValues

With Application
.CutCopyMode = False
.ScreenUpdating = False
End With
End Sub


---
Regards,
Norman



"Ronald Cayne" wrote in message
...
Want to copy data in Sheet1 a1:j1 Copy and paste Values
to Sheet 2 A1:j1


When Macro is rerun 1 want to copy the data Sheet1:a1:j1
to Sheet 2!a2:j2(Values only)

Each time I want to add the data from line 1 sheet 1 to the next
unoccupied line in Sheet 2

Ron







All times are GMT +1. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com