Billy Baxter
New Member
- Joined
- Dec 18, 2004
- Messages
- 17
- Office Version
- 365
- Platform
- MacOS
Hi
This is a popular code which I have copied and used many times - double-clicking on a row inserts a new row below with formulas etc.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Application.ScreenUpdating = False
Cancel = True
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
Application.ScreenUpdating = True
End Sub
For some reason and I have tried 3 different books I cannot get it to work so I'm assuming it is not the code (as it has worked very well previously) but perhaps some setting. Macros are enabled.
I am not a VBA expert by any means and I may not have set it up correctly in VBA.
Any help much appreciated.
Thanks
Billy
This is a popular code which I have copied and used many times - double-clicking on a row inserts a new row below with formulas etc.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Application.ScreenUpdating = False
Cancel = True
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
Application.ScreenUpdating = True
End Sub
For some reason and I have tried 3 different books I cannot get it to work so I'm assuming it is not the code (as it has worked very well previously) but perhaps some setting. Macros are enabled.
I am not a VBA expert by any means and I may not have set it up correctly in VBA.
Any help much appreciated.
Thanks
Billy