Hello There,
I would like to update a cell in a specific worksheet with the userid value. This should occur when the user saves or closes and saves the workbook
Below code I have written, and the save popup keeps coming up.
Could you please advice how my requirement could be achieved?
Thanks & regards,
Don
I would like to update a cell in a specific worksheet with the userid value. This should occur when the user saves or closes and saves the workbook
Below code I have written, and the save popup keeps coming up.
Could you please advice how my requirement could be achieved?
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Set ws = Worksheets("Main Menu")
'UserId is a global variable
ws.Range("R3").Value = UserId
Cancel = True
End Sub
Thanks & regards,
Don