Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("[COLOR=#ff0000]D:D[/COLOR]")) Is Nothing Then
Cancel = True
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Target.Value = DateAdd("m", 1, Target.Value)
End If
End Sub
Thank you; but I was hoping to be able to reference the name of the column to save having to update the script when I change the table.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim tbl As ListObject
Dim rngDateCol As Range
Set tbl = Me.ListObjects("Table1")
Set rngDateCol = tbl.ListColumns("Date").DataBodyRange
If Not Intersect(Target, rngDateCol) Is Nothing Then
Cancel = True
Target.Value = DateAdd("m", 1, Target.Value)
End If
End Sub