Hi,
Hoping some could help me. i was able to write the simple code with locked and unlocked cell based on a cell value however when i do a protect sheet function, it gave me an error "Run time Error "1004", unable to set the locked property on the range class"
basically here is the code
Private Sub worksheet_change(ByVal target As Range)
If Range("H10") = "Tier 3" Then
Range("H25:H29").Locked = True
Range("K10:K26").Locked = True
ElseIf Range("H10") = "Tier 1" Then
Range("H25:H29").Locked = False
Range("K10:K26").Locked = False
ElseIf Range("H10") = "Tier 2" Then
Range("H25:H29").Locked = False
Range("K10:K26").Locked = False
ElseIf Range("H10") = "Tier 4" Then
Range("H25:H29").Locked = True
Range("K10:K26").Locked = True
End If
End Sub
and i also have another question, in cell H13 there is a data validation function being used, drop down available for RT- with RI insurance and RT - with No RI Insurance however when the user select Tier 3 or Tier 4 in cell H10, it should only be the value - RT with NO RI insurance, how can i default that cell with the value when user select the Tier 3 or Tier 4.
thanks so much in advance
Hoping some could help me. i was able to write the simple code with locked and unlocked cell based on a cell value however when i do a protect sheet function, it gave me an error "Run time Error "1004", unable to set the locked property on the range class"
basically here is the code
Private Sub worksheet_change(ByVal target As Range)
If Range("H10") = "Tier 3" Then
Range("H25:H29").Locked = True
Range("K10:K26").Locked = True
ElseIf Range("H10") = "Tier 1" Then
Range("H25:H29").Locked = False
Range("K10:K26").Locked = False
ElseIf Range("H10") = "Tier 2" Then
Range("H25:H29").Locked = False
Range("K10:K26").Locked = False
ElseIf Range("H10") = "Tier 4" Then
Range("H25:H29").Locked = True
Range("K10:K26").Locked = True
End If
End Sub
and i also have another question, in cell H13 there is a data validation function being used, drop down available for RT- with RI insurance and RT - with No RI Insurance however when the user select Tier 3 or Tier 4 in cell H10, it should only be the value - RT with NO RI insurance, how can i default that cell with the value when user select the Tier 3 or Tier 4.
thanks so much in advance