Hi, I would like to find out how can I include the username of the person who has logged into the PC in the filename using VBA?
I heard of Environ[username/userprofile] and tried it but can't seem to make it work.
Please note that the macro is a shared document so that anyone that have access to the drive can use it.
Thanks in advance!
I heard of Environ[username/userprofile] and tried it but can't seem to make it work.
Please note that the macro is a shared document so that anyone that have access to the drive can use it.
Thanks in advance!
Code:
Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
"S:\Shared\Hello\Yes_High_" & Format(Date, "yyyymmdd") & ".xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Last edited: