Rebeccahelp needed
New Member
- Joined
- Sep 7, 2020
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hi,
I am doing a Macro which will copy data from one sheet to another. This is working if I have multiple rows to copy/paste, however if I have only 1 row of data to copy it tries to copy all rows in the worksheet and therefore there is not enough 'space' in the destination worksheet so nothing pastes.
I am using the below to select/copy the data I need:
Range("g2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
and the below to paste (this is working fine as long as I have more than 1 row of data to paste)
Sheets("Returns History").Select
Range("A1").Select
Range("A1").End(xlDown).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Thanks all.
I am doing a Macro which will copy data from one sheet to another. This is working if I have multiple rows to copy/paste, however if I have only 1 row of data to copy it tries to copy all rows in the worksheet and therefore there is not enough 'space' in the destination worksheet so nothing pastes.
I am using the below to select/copy the data I need:
Range("g2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
and the below to paste (this is working fine as long as I have more than 1 row of data to paste)
Sheets("Returns History").Select
Range("A1").Select
Range("A1").End(xlDown).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Thanks all.