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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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
[TABLE="width: 475"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD]TEAM ID[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]TIP TYPE[/TD]
[TD][/TD]
[TD]SUPPLIER[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="colspan: 2"] TOTAL PALLETS[/TD]
[TD]ARRIVED TIME[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]REFERENCE[/TD]
[TD]PALLETS[/TD]
[TD]REFERENCE[/TD]
[TD]PALLETS[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]X60[/TD]
[TD]W60[/TD]
[/TR]
[TR]
[TD]V61[/TD]
[TD]W61[/TD]
[TD]X61[/TD]
[TD]W61[/TD]
[/TR]
[TR]
[TD]V62[/TD]
[TD]W62[/TD]
[TD]X62[/TD]
[TD]W62[/TD]
[/TR]
[TR]
[TD]V63[/TD]
[TD]W63[/TD]
[TD]X63[/TD]
[TD]W63[/TD]
[/TR]
[TR]
[TD]V64[/TD]
[TD]W64[/TD]
[TD]X64[/TD]
[TD]W64[/TD]
[/TR]
[TR]
[TD]V65[/TD]
[TD]W65[/TD]
[TD]X65[/TD]
[TD]W65[/TD]
[/TR]
[TR]
[TD]V66[/TD]
[TD]W66[/TD]
[TD]X66[/TD]
[TD]W66[/TD]
[/TR]
[TR]
[TD]TRAILER[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
<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.
:huh: 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,223,958
Messages
6,175,632
Members
452,661
Latest member
Nonhle

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