Checklist formula

NoxGalleon106

New Member
Joined
Oct 15, 2016
Messages
29
Hi,

I am working on our checklist. The current setup is that, when cell in column D is double clicked
1. It will show a check mark
2. Cell in Column E will be updated with the time when the cell was double-clicked
3. Cell in Column F will be updated with the person's UserID

The issue that I am encountering is when the file is opened as another's PC. All the userID in column F will then updated with that person's ID.

For example: Simon signs off the checklist and "Simon" is shown in column F. But then, if another person opens the excel,
the userID will be changed to his/ her ID.

I think this is because of the formula in Column F - =IF(D4<>"",GetUserName(),"")

Do you have alternative formula/DBAcode for this? The idea is to show the maker's ID and the time it was signed off.

Thank you.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi,

I have the below alternative code but unsure how to incorporate with my existing code. Please help.
Thank you.

Alternative code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 4 Then
ThisRow = Target.Row
If (ThisRow = 4) Then Exit Sub
Range("E" & ThisRow).Value = Now
Range("F" & ThisRow).Value = Environ("username")
Range("E:F").EntireColumn.AutoFit
End If

If Target.Column = 7 Then
ThisRow = Target.Row
If (ThisRow = 7) Then Exit Sub
Range("I" & ThisRow).Value = Now
Range("J" & ThisRow).Value = Environ("username")
Range("I:J").EntireColumn.AutoFit

End If
End Sub

Existing code:

Private Sub Worksheet_Change(ByVal target As Range)

If Intersect(target, Range("C64")) Is Nothing Then Exit Sub
Application.EnableEvents = False
If target.Value <> Application.UserName Then
Application.EnableEvents = False
MsgBox "Hi " & Application.UserName & "!" & " Please do not sign off on behalf of others.", vbOKOnly
target.ClearContents
Else
target.Offset(0, 1) = Now()

End If


Call PDF

Application.EnableEvents = True

End Sub
 
Upvote 0
Try this

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Not Intersect(Target, Range("C64")) Is Nothing Then
        If Target.Value <> Application.UserName Then
            MsgBox "Hi " & Application.UserName & "!" & " Please do not sign off on behalf of others.", vbOKOnly
            Application.EnableEvents = False
            Target.ClearContents
            Application.EnableEvents = True
        Else
            Target.Offset(0, 1) = Now()
        End If
        Call PDF
    End If
    
    If Target.Column = 4 Then
        ThisRow = Target.Row
        If (ThisRow = 4) Then Exit Sub
        Range("E" & ThisRow).Value = Now
        Range("F" & ThisRow).Value = Environ("username")
        Range("E:F").EntireColumn.AutoFit
    End If


    If Target.Column = 7 Then
        ThisRow = Target.Row
        If (ThisRow = 7) Then Exit Sub
        Range("I" & ThisRow).Value = Now
        Range("J" & ThisRow).Value = Environ("username")
        Range("I:J").EntireColumn.AutoFit
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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