View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Double click cell to execute macro

Right click on the worksheet tab, choose View Code, and paste in the
following code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim RowNum As Long
If Target.Cells.Count 1 Then
Exit Sub
End If
If Target.Column < 1 Then
Exit Sub
End If
Me.Rows(Target.Row + 1).Insert
Me.Rows(Target.Row).Resize(2).FillDown
Cancel = True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"JDaywalt" wrote in message
...
Let's say I have a range of data in cells B1 thru Z100. In would like to
designate column A as the "selector" column, whereby a user could
replicate
the chosen row by double-clicking in the column A next to the chosen row.
For example, if the user wants to replicate row 10, they would go to cell
A10, double-click, and it would copy/paste row 10 into row 11 (shifting
the
other rows down to avoid overwriting them). Is this possible to do?