Double click in cell and copy the value into another cell

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,280
Office Version
  1. 2013
Platform
  1. Windows
Good Day and Happy New Year,
The datas has stored in columns "a:g" all the way down.
When i double click any cell in column "A" I would like to store the value one by one into the column "K" from first cell to down.Is it possible?
 
I am using a similar code to highlight on double click, how can i add the double clicked cell to copy and paste to a merged cell?
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I am using a similar code to highlight on double click, how can i add the double clicked cell to copy and paste to a merged cell?
vba and merged cells don't go that well together. Have a browse through this thread.

Even so, I'm sure it would be possible to do what you want. However, like the early part of this thread, more detail would be required.
 
Upvote 0
Thanks Peter! I am using the below code and i wanted to after highlighted to copy and paste into that merged cell..
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim c As Range
Dim FirstAddress As String
Static ColIdx
Cancel = True
If IsEmpty(ColIdx) Then ColIdx = 33 Else ColIdx = ColIdx + 1
If ColIdx > 46 Then ColIdx = 33
ActiveCell.Interior.ColorIndex = ColIdx
With Range("A5:R62")
  Set c = .Find(ActiveCell.Value, LookIn:=xlValues)
  If Not c Is Nothing Then
    FirstAddress = c.Address
    Do
      c.Interior.ColorIndex = ColIdx
      Set c = .FindNext(c)
    Loop While Not c Is Nothing And c.Address <> FirstAddress
  End If
End With
End Sub
 
Upvote 0
Regtompj's question has been duplicated here. Please continue in that thread.
 
Upvote 0
If column K starts off empty, then this will actually start the list in K2 then go down. If that is a problem post back and the code can be tweaked to start in row 1. I left it like this because the code was a bit simpler and I thought you might be having a heading in K1 anyway?

If you need help with the code implementation, post back.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 1 Then
Range("K" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
End If
End Sub



Hi can you show me how to paste data in K colum in other sheet (sheet2 for example) starting from row K10 insted K2
 
Upvote 0
Welcome to the MrExcel board!

Could you add a bit more detail about just what you have and what you want to achieve?
 
Upvote 0
Welcome to the MrExcel board!

Could you add a bit more detail about just what you have and what you want to achieve?

Thx you Peter. Well story iz the sam as 1st thread. Column K will be the destination but on second sheet.So if i double click on A10 the data in A10shee1(digit numbers) will go to K10Sheet2...then A5Sheet1 will be in K11Sheet2 ...any cell I do double click in coumn A$Sheet1 it will go trough to column K$Sheet2 in last cell.
Thanks in advance.
 
Upvote 0
OK, try this in a copy of your workbook. To implement ..

1. Right click the Sheet1 name tab and choose "View Code".

2. Copy and Paste the code below into the main right hand pane that opens at step 1.

3. Close the Visual Basic window.

<font face=Courier New><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_BeforeDoubleClick(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Range, Cancel <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Boolean</SPAN>)<br>    <SPAN style="color:#00007F">Dim</SPAN> r <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>    <br>    <SPAN style="color:#00007F">If</SPAN> Target.Column = 1 <SPAN style="color:#00007F">Then</SPAN><br>        Cancel = <SPAN style="color:#00007F">True</SPAN><br>        <SPAN style="color:#00007F">With</SPAN> Sheets("Sheet2")<br>            r = .Range("K" & Rows.Count).End(xlUp).Row + 1<br>            r = IIf(r < 10, 10, r)<br>            .Range("K" & r).Value = Target.Value<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,756
Members
449,187
Latest member
hermansoa

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