+ Reply to Thread
Results 1 to 5 of 5

"broken" formula!

  1. #1
    Registered User
    Join Date
    07-28-2007
    Posts
    3

    Unhappy "broken" formula!

    I created a spreadsheet last year with a formula that would display whether or not the spreadsheet was protected. Anyway, when I opened the spreadsheet to make new year updates the formula is "broken" and only displays #NAME?. The formula is:

    =IF(IsProtected.IsProtected(), "Protected", "Unprotected")

    I know I'm missing some code or something somewhere but unfortunately I'm such a novice I have no idea what or where or when or ... well, you get the picture!

    Help!

    Thanks!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Sbrown54,

    What version of Excel are you using?

    Thanks,
    Leith Ross

  3. #3
    Registered User
    Join Date
    07-28-2007
    Posts
    3
    Sorry! I suspect that might be useful! Excel 2003 SP2.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Sbrown54,

    I suspect there was a User Defined Function that determined if a given sheet was protected. This macro will determine if the named worksheet is protected by returning a True or False.
    Please Login or Register  to view this content.
    To Install the Macro:
    1. Copy the Macro code above using CTRL+C
    2. Open Excel and Right Click on any Sheet Tab
    3. Click on View Code in the pop up menu
    4. Use ALT+I to activate the VBE Insert Menu
    5. Press the letter m to insert a Standard Module
    6. Paste the macro code using CTRL+V
    7. Save the macro using CTRL+S
    8. Close the VBE and return to excel using ALT+Q

    Worksheet Example
    This checks if the ActiveSheet (the one the formula is on) is protected.
    Please Login or Register  to view this content.
    To check another worksheet in the workbook is protected, enter the name as a String.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    07-28-2007
    Posts
    3

    Thumbs up

    PERFECT!

    I knew I had "lost" some code but have no idea how or what it was, I really appreciate your help.

+ 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