VBA object to copy a row when that row is clicked...

seandotson

New Member
Joined
Mar 30, 2015
Messages
6
I have a sheet where I have a series of columns with info. I need the ability to click on a button or object in that row and copy that row (technically a range of that row) to the clipboard.

This could easily be solved with VB object control arrays but those do not exist in VBA.

Any suggestions on how to make this work...(I have the code to make the button copy, need help with the object to use to trigger the code)

A visual example: http://i.imgur.com/3BanpHS.png
 
If you are pasting into another instance of Excel, then Excel refuses to take the formulas across. If it is in the same instance then it should work.

But my question will be: if you are pasting from one workbook to another:
  1. why are you not using: range1.copy destination:=range2 instead of putting it to the clipboard?
  2. why would you paste it into another instance of Excel?
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I have just reread your question and I think we forgot something that would avoid us the need to write tons of code .. Just set the Cancel Argument to true and this will probably solve your problem :

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim CopyData As Range
    On Error Resume Next
    
   [B] Cancel = True[/B]
    Set CopyData = Range("C" & Target.Row & ":W" & Target.Row)
    CopyData.Copy

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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