View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Need syntax for If user name in before save event

What would be the code to MsgBox the user name in Tools,
Options, General?


MsgBox Application.UserName

However, more importantly, how can I get the If statement to
work?


Your code should work. Are you sure capitalization is correct?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"mikeburg"
wrote in
message
...

What I mean is that anything within the If statement does not
execute.

Yes, I am sure that UserName is mike, because I can put the
following
in the before save event & the message box displays the word
Mike

Msgbox Environ("UserName")

Also, thanks for your comment about the log on name. I didn't
realize
that. What would be the code to MsgBox the user name in Tools,
Options, General?

However, more importantly, how can I get the If statement to
work?

If Environ("UserName") = "Mike" then Msgbox Environ("UserName")

Thanks for your replys. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:
http://www.excelforum.com/member.php...o&userid=24581
View this thread:
http://www.excelforum.com/showthread...hreadid=508723