I have not used VBA at all and was wondering if anyone could help me with automatically running a macro when opening a workbook? I get an error when opening the workbook stating:
"Run-time error '424': Object required"
Here is the code I tried:
Private Sub Workbook_Open()
GetUserName = Application.username
End Sub
Function GetUserName()
GetUserName = Application.username
End Function