Auto Update Current Date to a Cell in Excel when Double clicked (VBA Macro)

Updating today's date to a Cell when double clicked using Mouse.

Follow the link to add the VBA Macro Codes to the Excel.

Add the following Macro Code to the Woksheet Module:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("B:B")) Is Nothing Then
        Cancel = True
        Target.Formula = Date
    End If
End Sub


Values:
B:B -> Is the Column/Row range in which you want the date to appear.

No comments:

Post a Comment

Thank You.

https://linwintech.blogspot.com/