Hello,
I have a worksheet with a table with data information on the the following columns A:H. I need to assign a macro to the Worksheet that will perform the following events: once the user selects a cell from column B and double clicks in that cell, the macro inserts a new row bellow the selected row with:
1) same values in columns A:N of selected row
2) Delete values (only keep formats) in columns F:H
I found in this forum the following macro that was great, but I do not know how a can get the macro to run inside the table. i feel like i need to reference the (Table 3 ) but cant figure out where in the statement to properly put it
- Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
- If ActiveCell.Column = 1 Then
- 'David McRitchie, 2007-09-07 insrtrow.htm on double-click
- '-- will copy more often than Extend Formulas and Format (tools option)
- Cancel = True
- Target.EntireRow.Copy
- Cells(Target.Row + 1, 1).EntireRow.Insert
- Cells(Target.Row + 1, 1).EntireRow.Select
- ActiveSheet.Paste
- Application.CutCopyMode = False
- On Error Resume Next
- '-- customize range for what cells constants can be removed --
- Intersect(Selection, Range("F:H")).SpecialCells(xlConstants).ClearContents
- On Error GoTo 0
- Else
- End If
- End Sub