Just re-iterating the others
jasoncw's point is critical... anyone can change the Application.Username as outlined ... the NT id is of course (in theory) much more secure... if that's what you want to use (advised if in Network environment) then search:
and you should find plenty of info.
As outlined by Roy's code VBA unlike native XL is case-sensitive by default (Apple <> apple) so either :
a) coerce strings to common case when comparing
or
b) as Roy outlined - use
statement at head of the Module containing the code so as to make that Module case in-senstive (apple = Apple)
Bookmarks