Results 1 to 2 of 2

Locking a formula in a column where the values change based on drop down menu

Threaded View

uhm_81 Locking a formula in a column... 08-20-2014, 09:34 AM
jewelsharma Re: Locking a formula in a... 08-20-2014, 09:57 PM
  1. #1
    Registered User
    Join Date
    08-19-2014
    Location
    bujumbura
    MS-Off Ver
    2013
    Posts
    6

    Locking a formula in a column where the values change based on drop down menu

    Hello all,

    I hope you are well.

    I have created a drop-down menu combobox of districts and depending on your choice of districts the list of Health Centers in a specific column changes. What I want to do is to protect the contents of the column and the cells that contain the health centers. The problem is that when I lock the cells and I choose a district, the Health Center cells cannot change because the cells are locked. Is there anyway around it?

    I was told to insert the following code into the sheets code:
    Private Sub ComboBox1_Change() 
        ActiveSheet.Protect 
    End Sub 
     
     
    Private Sub ComboBox1_DropButtonClick() 
        ActiveSheet.Unprotect 
    End Sub
    I went to the Developer Tab then I chose View Code then I clicked on the Sheet 2 (Sheet 1) and I pasted the code. I got a warning saying that VBA cannot work unless I save in macro-enabled sheet so I did (xlsm).

    I have attached the sample (Please look at sheet 2. The column that I want to block is the column FOSA)

    Thank you
    Ulises
    Attached Files Attached Files
    Last edited by JBeaucaire; 08-20-2014 at 10:15 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Locking a cell based on drop down menu selection (Protected Worksheet)
    By DRogersICF in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2014, 03:52 PM
  2. Change value of cell based on a drop down menu option.
    By laxtui in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2013, 07:23 AM
  3. Change column in formula based on drop down list
    By tantcu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-07-2013, 09:17 PM
  4. Want picture to change based on value selected in drop down menu
    By omartin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2013, 05:38 PM
  5. Locking Formula Cells only-SOLVER AND DROP DOWN MENU
    By gtg430i in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2008, 03:32 PM

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