copy paste double click

es0019

New Member
Joined
Jul 24, 2018
Messages
12
Hello
IF anyone can help me please
My question is how can make it work when double clicking on cell copy the contents of this cell and from another cell and then paste the contents from both at another cells.For examble double click on cell D4 copy the contents of D4 and contents of K4 from the same row and paste them with one click to any other active cell let say clicking on cell v60 to paste D4 and on W60 to paste K4

Thanks
 
Hi Peter_SSs I thought Cancel = True should go immediately before End Sub, so it's executed independent of test condition?
No, if the user wants to edit cell contents by double-clicking, we don't want to deny them that on the whole worksheet, only if they double-click in column D to trigger the copy/paste procedure.
That is, if the user want to edit, say, cell J10 by double-clicking, we would want to still allow them to do that as it is unrelated to the purpose of this code.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi and thank you again working perfect. Please I would like to improve a bit
It is possible to keep exactly the part of copy and change paste to specific range and only values of cells. So when copy the values from 2 cells I want to paste special to any of the couple cells in specific range and not anywhere on the sheet. The range is as couples (V61,W61) to (V66,W66) and (X60,Y60) to (X66,Y66).If its not possible I am happy and how it works now only if can paste only the values.
Thank you
 
Upvote 0
I'm not understanding where the paste should go. You say "paste to specific range" but also "paste special to any of .."
Can you explain exactly how we decide where the paste (special) should go?
 
Upvote 0
Hello and thank you. Sorry my English are not so good and maybe you cant understand me..I want to paste only the values at range below and NOT anywhere o sheet.
The range is as couples (V61,W61) to (V66,W66) and (X60,Y60) to (X66,Y66).If its not possible I am happy and how it works now only if can paste only the values.
You can find not below sample to show you where I need to paste

Thank you
TEAM ID
TIP TYPESUPPLIER
TOTAL PALLETSARRIVED TIME
0
REFERENCEPALLETSREFERENCEPALLETS
X60W60
V61W61X61W61
V62W62X62W62
V63W63X63W63
V64W64X64W64
V65W65X65W65
V66W66X66W66
TRAILER

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
<strike></strike>
 
Upvote 0
Sorry my English are not so good and maybe you cant understand me..
I think that may be the problem, but let's try again with a specific example.

Suppose I double-click on D6

1. Can you confirm that we still should copy D6 and K6

2. Now, we have to paste (values only) somewhere. You have listed 13 pairs of cells.
- Should the two values get pasted 13 times into all those cells?
- If not, do the 2 values get pasted into one of those 13 pairs of cells? If so, how do we decide which pair of those cells we paste the values into?
 
Upvote 0
Thank you for your help. What I want is to copy ANY pair from columns and range D6:D200 and K6:K200 and paste at ANY of those 13 pairs. If that is complicate
I will use your vba code but if its possible when I paste them anywhere to be only the values.
Thanks

ps

For example D12 with K12 paste to V61 and W61
D18 with K18 paste to V62 and W62
 
Last edited:
Upvote 0
.. and paste at ANY of those 13 pairs.
:unsure: That seems very strange to me. This code will do that, though I'll be very surprised if you don't come back asking for something different.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  If Target.Column = 4 Then
    Cancel = True
    Range("V61").Value = Target.Value
    Range("W61").Value = Target.Offset(, 4).Value
  End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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