+ Reply to Thread
Results 1 to 3 of 3

macro to run as result of if statement

  1. #1
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    macro to run as result of if statement

    i cant get this to work
    what i'm expecting is, if sheet is protected
    message box
    if not protected then run sub draw()
    blah
    blah
    protect sheet
    done
    all it does is give message box never goes to sub draw()
    Please Login or Register  to view this content.
    im using excel97
    thanx

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    This command actually protects the sheet, it does not test if a sheet is protected
    Please Login or Register  to view this content.
    try using
    Please Login or Register  to view this content.
    I have Excel 2003 & can only assume the command works in 97
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    i actually tried to use that first time around but it kept coming up
    highlighted as an error!
    but i know realise that was when i had it in the wrong place in the code
    but stupidly assumed that the syntax was wrong so tried first example
    since that didnt go yellow i thought it was ok and continued using it.
    well it was 2 a.m.
    code now works fine
    thanx

+ 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