Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
copy offset to cell | Excel Discussion (Misc queries) | |||
Why Copy/Paste fails using Offset & Resize of myRange? | Excel Discussion (Misc queries) | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
copy and paste with offset | Excel Discussion (Misc queries) |