Copying of Entire Row - Almost There!

dominicwellsuk

New Member
Joined
Mar 23, 2011
Messages
28
Hi, I'm trying to put together some VBA that allows a user to select a cell on the sheet, then copies the entire row corresponding with that cell to the clipboard, to be pasted at a later point. Code is as follows so far:

Sub ROWCOPY()
Rows(ActiveCell.Row).Select
With New DataObject
.SetText ActiveCell.Text
.PutInClipboard
End With
End Sub

The problem with this is that the data on the clipboard appears to only be the value in Column A of the row. I can't get it to copy the full row.

Any ideas how to get this done? :confused:

Thanks.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi, I'm trying to put together some VBA that allows a user to select a cell on the sheet, then copies the entire row corresponding with that cell to the clipboard, to be pasted at a later point. Code is as follows so far:

Sub ROWCOPY()
Rows(ActiveCell.Row).Select
With New DataObject
.SetText ActiveCell.Text
.PutInClipboard
End With
End Sub

The problem with this is that the data on the clipboard appears to only be the value in Column A of the row. I can't get it to copy the full row.

Any ideas how to get this done? :confused:

Thanks.

Code:
sub test()
 
RANGE(SELECTION, SELECTION.END(XLTORIGHT)).COPY
 
end sub
 
Upvote 0
Seems to do the job, although some of the cells in the row are blank, and it stops at these so it would have to ignore the blanks and copy the entire row.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top