Add in a validation procedure that verifies whether the user is allowed to
run the specific macro. Create a sheet which will be set very hidden so that
the user can not see it (without getting inot the code) and designate the
users who should be allowed to run the macro The list will be their NT user
names. Your functin will check the NT username against the list. To get the
username use Environ("User Name)... so the function will look something like
this... (untested)
public function AuthorizedUser () as boolean
dim rngFound as range
dim rngToSearch As range
dim wks as worksheet
set wks = sheets("My Users")
set rngtosearch = wks.range("A:A")
set rngfound = rngtosearch.find(Environ("User Name"))
if rngfound is nothing then
AuthorizedUser = false
else
AuthorizedUser = true
end if
end function
--
HTH...
Jim Thomlinson
"JAL" wrote:
> In Excel 2003. how can I restrict different users within the same file from
> running the same macro? Is there a way to password protect a macro so that
> only the designated user with the correct password can run the macro
> (currently I'm using buttons to initiate the macros)?
Bookmarks