+ Reply to Thread
Results 1 to 4 of 4

Macro Protection

  1. #1
    Registered User
    Join Date
    02-26-2006
    Posts
    11

    Macro Protection

    Hi again,

    i have a simple macro that clears unlocked cell contents on a worksheet. However, as the worksheet is used by several people its possible one of them may run the macro...unlikely but i'd rather they didn't have the choice. Is it possible to password protect the macro or something similar?


    Thanks.

  2. #2
    Norman Jones
    Guest

    Re: Macro Protection

    Hi Fodman,

    If you preface your macro with the word Private, the macro will not show up
    in the list of macros, e.g.:

    Private Sub MyMacro

    'Your code

    End sub

    Alternatvely, try something like:

    '=============>>
    Public Sub MyMacro()
    Dim res As String

    res = InputBox("Insert the password")

    If res <> "YourPassword" Then
    Exit Sub
    End If

    'Your code

    End Sub
    '<<=============


    ---
    Regards,
    Norman


    "fodman" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi again,
    >
    > i have a simple macro that clears unlocked cell contents on a
    > worksheet. However, as the worksheet is used by several people its
    > possible one of them may run the macro...unlikely but i'd rather they
    > didn't have the choice. Is it possible to password protect the macro or
    > something similar?
    >
    >
    > Thanks.
    >
    >
    > --
    > fodman
    > ------------------------------------------------------------------------
    > fodman's Profile:
    > http://www.excelforum.com/member.php...o&userid=31941
    > View this thread: http://www.excelforum.com/showthread...hreadid=555276
    >




  3. #3
    Registered User
    Join Date
    02-26-2006
    Posts
    11
    Am i missing something?....How then do i find the macro if it doessn't show up in the macro list?


  4. #4
    Norman Jones
    Guest

    Re: Macro Protection

    Hi Fodman,

    Even though the macro will not show up in the macro dialog, you can run the
    macro by typing the macro's name.

    However, why not try my suggested password suggestion?


    ---
    Regards,
    Norman


    "fodman" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Am i missing something?....How then do* i *find the macro if it doessn't
    > show up in the macro list?
    >
    >
    >
    >
    > --
    > fodman
    > ------------------------------------------------------------------------
    > fodman's Profile:
    > http://www.excelforum.com/member.php...o&userid=31941
    > View this thread: http://www.excelforum.com/showthread...hreadid=555276
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1