How to Insert User Initial and Date Stamp in excel on double click?

mistylsand

New Member
Joined
Sep 16, 2020
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
I have an excel spreadsheet that is a checklist and once items are complete i would like the users to double click the cells and it stamp their initials and the date. I have seen others ask the same thing and they have come up with code to pull the username and date which is working for me but i only want the user initials. I have not been able to find any other code pulling the initials that actually work.
I would also like 2 options 1 with the date and 1 without the date.

Does anyone know how to get the user initials and date stamp on double click? I also have a range of cells i need this to apply to N2:AQ2000
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
This would put the initials followed by the date in any cell double clicked in N2:AQ2000.
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim strInitials As String

    strInitials = Join(Evaluate("LEFT({""" & Replace(Application.UserName, " ", """,""") & """})"), "")
    
    If Not Intersect(Target, Range("N2:AQ2000")) Is Nothing Then
        Cancel = True
        Application.EnableEvents = False
        Target.Value = strInitials & "-" & Date
        Application.EnableEvents = True
    End If
    
End Sub
 
Upvote 0
You are totally awesome, this is exactly what i needed!! Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top