Copy target as well as three cells to the left of the target.

Sonican

New Member
Joined
Jun 20, 2016
Messages
13
Is there any way that I can copy, on the double click of any cell in column A, the cell that I clicked on as well as the 3 cells to the right of that cell in sheet1, and then paste them in a column on sheet2 in the cells B2:B5.

Alternatively, is there any way when i double click a cell to have excel copy the cell one to the left of the one that i double clicked? My thought is that i could be able to just make a different macro for offsetting the copy one cell then two then three form the one that I selected.

Thanks for your help!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi Sonican,

Does this do what you want.

Copy code to the Sheet1 module.

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)


    If ActiveCell.Column <> 1 Then End
    Range("A" & Target.Row & ":D" & Target.Row).Copy
    Worksheets("Sheet2").Range("B2").PasteSpecial Paste:=xlPasteValues, Transpose:=True
    Application.CutCopyMode = False
    
End Sub

HTH

igold
 
Upvote 0

Forum statistics

Threads
1,215,616
Messages
6,125,860
Members
449,266
Latest member
davinroach

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