Cut/Copy in VBA
Solved/Closed
Chamberlyn
Posts
4
Registration date
Sunday November 25, 2012
Status
Member
Last seen
December 19, 2013
-
Nov 25, 2012 at 09:47 PM
Chamberlyn Posts 4 Registration date Sunday November 25, 2012 Status Member Last seen December 19, 2013 - Nov 26, 2012 at 08:27 PM
Chamberlyn Posts 4 Registration date Sunday November 25, 2012 Status Member Last seen December 19, 2013 - Nov 26, 2012 at 08:27 PM
Related:
- Cut/Copy in VBA
- Vba case like - Guide
- Number to words in excel formula without vba - Guide
- Cut pdf download - Download - PDF
- Vba check if value is in array - Guide
- How to open vba in excel mac - Guide
3 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Nov 26, 2012 at 09:34 AM
Nov 26, 2012 at 09:34 AM
Hi Chamberlyn,
So you would like to copy your manual selected range and paste it to the next sheet in the first available row.
If this is true then the following code should suffice:
Best regards,
Trowa
So you would like to copy your manual selected range and paste it to the next sheet in the first available row.
If this is true then the following code should suffice:
Sub test() Sheets("Sheet3").Activate Selection.Copy Sheets("SAP Report").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End Sub
Best regards,
Trowa
Chamberlyn
Posts
4
Registration date
Sunday November 25, 2012
Status
Member
Last seen
December 19, 2013
Nov 26, 2012 at 04:19 PM
Nov 26, 2012 at 04:19 PM
Good Morning TrowaD,
Thank you so much for you reply. I actually need to copy a table which increases each update, to a second worksheet in the same workbook. The copy from the first sheet (sheet 3) will over write any data existing in the second worksheet (SAP Report) but the first line of the copied data will start in row A6:K6 in SAP Reports worksheet.
The actual table data range in ("sheet3") to be copied starts in columns A2:K? as I do not want to copy the headers. In the "SAP Report" worksheet where the data is going the table must start as mentioned above into row A6. I can't do a sheet cut and paste because there are 3 more (L,M,N)columns in the (SAP Report) worksheet which contain formula that I don't want to overwrite. Hope this clarifies the issue.
Kind Regards
Thank you so much for you reply. I actually need to copy a table which increases each update, to a second worksheet in the same workbook. The copy from the first sheet (sheet 3) will over write any data existing in the second worksheet (SAP Report) but the first line of the copied data will start in row A6:K6 in SAP Reports worksheet.
The actual table data range in ("sheet3") to be copied starts in columns A2:K? as I do not want to copy the headers. In the "SAP Report" worksheet where the data is going the table must start as mentioned above into row A6. I can't do a sheet cut and paste because there are 3 more (L,M,N)columns in the (SAP Report) worksheet which contain formula that I don't want to overwrite. Hope this clarifies the issue.
Kind Regards
Chamberlyn
Posts
4
Registration date
Sunday November 25, 2012
Status
Member
Last seen
December 19, 2013
Nov 26, 2012 at 08:27 PM
Nov 26, 2012 at 08:27 PM
For anybody who is interested, I have worked out a solution to my issue
Set tbl = ActiveCell.CurrentRegion
Worksheets("Sheet3").Activate
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, _
tbl.Columns.Count).Select
Selection.Copy
Sheets("SAP Report").Select
Range("A6").Select
ActiveSheet.Paste
Sheets("Sheet3").Select
Application.CutCopyMode = False
Thanks for the help though TrowaD, Regards
Set tbl = ActiveCell.CurrentRegion
Worksheets("Sheet3").Activate
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, _
tbl.Columns.Count).Select
Selection.Copy
Sheets("SAP Report").Select
Range("A6").Select
ActiveSheet.Paste
Sheets("Sheet3").Select
Application.CutCopyMode = False
Thanks for the help though TrowaD, Regards