Mr trying to learn
New Member
- Joined
- Jan 15, 2019
- Messages
- 1
So I used to work with a co-worker who used this excel macro to do his daily checklist and he sent it to me a long time ago. I never had the need to use it till now, when you double left click it timestamps the cell with the initials of your logon username and the date which is perfect for my daily checklist. The problem is that I am having a error when I try to double click.
I am using windows 10 and the latest excel.
So say the time is 12:57 pm and my name is Barry Kern I would double click the cell and it would do this. BK 12:57 and be a bright green color.
The exact error when I double click.
I then open the debugger
I have tried messing with his code. I deleted the (i) line of code because I saw that it was highlighted and its does timestamp the cell and make it green but does not put in the initials which I really need because this file is in a shared folder with many people working on the checklist and I like to keep track of who checks what off.
I am using windows 10 and the latest excel.
So say the time is 12:57 pm and my name is Barry Kern I would double click the cell and it would do this. BK 12:57 and be a bright green color.
The exact error when I double click.
I then open the debugger
Code:
Private Sub Worksheet_BeforeDoubleClick(<wbr>ByVal Target As Range, Cancel As Boolean)
UserName = Application.UserName
Cancel = True
Dim d() As String
r = UserName
d() = Split(r, ", ")
i = Left(d(1), 1) & Left(d(0), 1)
Target.Interior.Color = vbGreen
Target.Value = i & " " & FormatDateTime(Time, 4)
End Sub
I have tried messing with his code. I deleted the (i) line of code because I saw that it was highlighted and its does timestamp the cell and make it green but does not put in the initials which I really need because this file is in a shared folder with many people working on the checklist and I like to keep track of who checks what off.