Copy Cells on Double Click

ayazgreat

Well-known Member
Joined
Jan 19, 2008
Messages
1,151
Hi All

I have extracted below code from this site.

Code:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
    If Intersect(Target, Range("A1:A10")) Is Nothing Then Exit Sub
    
    Cancel = True
    
    Range("B1") = Range("B1") & vbCrLf & Target.Value
    
End Sub

The issue is that I want to copy values from different cells when I double click Target, Range("A1:A10")) the codes copy
on the same row value like if double click on A1 then code copy A1 cell to AA1 , B1 to AA5 and C1 to BB2.

if double click on A2 then code copy A2 cell to AA1 , B2 to AA5 and C2 to BB2. and like this on other target cells.

Can it be possible ???
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

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