View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Simon Lloyd[_128_] Simon Lloyd[_128_] is offline
external usenet poster
 
Posts: 1
Default Password protected macro


You can put a line of code or two just before your main code, something
like:

If environ("username")< "Simon" Or
environ("username")< "Bob" Then Exit Sub

Now if the windows logon name is not equal to Simon or Bob the sub will
exit everytime!

Beverly Darvill;263256 Wrote:
Is there a way to password protect a macro.

The workbook it will run in is already password protected but I don't
want
other users (they open it in Read Only with on the Administrators
opening it
full mode) inadvertantly clicking the macro although it won't cause any
problem if they do just will stop them from viewing the workbook for
about 5
mins dependant on the number of worksheets the macro has to update.

Thanks



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=73487