Set and Lock Value in Cell based on user selected input in Data Validation List

sonofasailor

New Member
Joined
Aug 13, 2012
Messages
1
Hello!

I am trying to set and lock the values in two cells when the user selects a particular value from a drop down list in another cell.

Each of the cells have data validation lists as well and they are all different.

Here is what I currently have but it errors on setting the value on H29. The error message i receive is Method 'Value' of object 'Range' failed.

I truly appreciate any help that can be offered!

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If [H28] = "-" Then
ActiveSheet.Unprotect
[H29].Value = "N"
[H30].Value = "-"
[H29].Locked = True
[H30].Locked = True
ActiveSheet.Protect
Else
ActiveSheet.Unprotect
[H29].Locked = False
[H30].Locked = False
ActiveSheet.Protect
End If
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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