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

mistylsand

New Member
Joined
Sep 16, 2020
Messages
2
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
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,271
Office Version
  1. 365
Platform
  1. Windows
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
 

mistylsand

New Member
Joined
Sep 16, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
You are totally awesome, this is exactly what i needed!! Thank you so much!
 

Watch MrExcel Video

Forum statistics

Threads
1,127,529
Messages
5,625,344
Members
416,096
Latest member
forevans

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
Top