Formula:
1. [b]Open the Visual Basic Editor[/b] by pressing Alt + F11.
2. In the editor, [b]insert a new module[/b] by clicking on Insert Module.
3. In the module, [b]create a new sub[/b] by typing "Sub GetUserID()" followed by pressing Enter.
4. Inside the sub, [b]declare a variable[/b] to hold the user id by typing "Dim UserID as String" followed by pressing Enter.
5. Use the [b]Environ function[/b] to retrieve the username by typing "UserID = Environ("USERNAME")" followed by pressing Enter.
6. You can now use the [b]UserID variable[/b] in your macro to check if the user id matches a specific value. For example, you can use an If statement like this:
If UserID = "SmithJo" Then
'Do something
Else
'Do something else
End If
7. [b]Save your macro[/b] and close the Visual Basic Editor.
Now, when the macro is executed, it will retrieve the user id of the person running the macro and store it in the UserID variable. You can then use this variable to perform actions based on the user id.