Dropdown box protection

bloesch1

New Member
Joined
Aug 24, 2010
Messages
25
Hi, I have a protected worksheet that has a number of macros that work correctly which are similar in that they unprotect the sheet at the beginning and protects it when the macro has finished. However, I have a dropdown box that I'm attempting to apply the same logic to which isn't working correctly.

When I select a value from the dropdown list, I receive an error stating that the cell or chart I'm trying to change in protected and therefore read-only. Once I hit ok, the feature works fine and I'm able to select a value from the list and get the correct output. From the code below, can you see why I'm still receiving the initial error?

Thank you!

Sub DropDown133_Change()
Sheets("MainMap").Unprotect Password:="password"

Dim strMap As Integer

strMap = Range("I4").Value
Select Case strMap
Case 1
1
Case 2
2
Case 3
3
Case 4
4
Sheets("MainMap").protect Password:="password"
End Select


End Sub
 
I may not be proficient enough in the VBA relationships to give you exact answers.

I do not believe this is in a form- everything has been inputted in a module and the dropdown is a button.

I did put your code into the module, but I'm afraid I did not see any different results.

Thanks again,
Brian
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,213,557
Messages
6,114,287
Members
448,562
Latest member
Flashbond

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top