+ Reply to Thread
Results 1 to 2 of 2

Worksheet_Change not working

  1. #1
    Registered User
    Join Date
    04-28-2009
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    1

    Worksheet_Change not working

    I have 3 option buttons that populate cell K5 with "ELEV2", "STA2" OR "GRADE"

    Cells D8, D10, D12, H8 and H10 are user input that will constantly be changed by user

    I need help getting it to auto update when the user changes any of D8, D10, D12, H8 or H10.

    Also I would like to lock H10 in the Case of ELEV2, but when I insert Range("H10").Locked = True , i get an error
    Any help would be great, I am a beginner!! (Excel 2007)

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Worksheet_Change not working

    Well, you could dispense with the locking/unlocking and put this line of code at the top:
    Please Login or Register  to view this content.
    Even if the sheet is already password protected, this sets the flag that allows macros to run freely on the locked sheet. It doesn't unprotect the sheet from the user's point of view.

    So, there's no need to "reprotect" later because you never removed the protection. See if you get better results with this.

    If not, this is still a technique worth adopting.

    ========
    Also, you're on Excel 2007, which means your sheets can easily outstrip the limitations of the "Integer" variable declaration. Go ahead and switch to "Long" for all those declarations to keep from ever running into issues with that.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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