Sir, Ma'am,
I have a piece of code that locks a cell down after the user selects items from the drop-down list associated with the cell. There is a button on the adjacent cell to the right that needs to be automatically deleted when several items of the drop-down list are chosen. The drop down list choices are " ", "As required", "Monthly", "Quarterly", and "Annual". Selecting ". When Blank, Monthly, Quarterly and Annual are chosen the button on cell to right needs to be removed or deleted. The code below locks down the cell but does not delete the button as required.
I have a piece of code that locks a cell down after the user selects items from the drop-down list associated with the cell. There is a button on the adjacent cell to the right that needs to be automatically deleted when several items of the drop-down list are chosen. The drop down list choices are " ", "As required", "Monthly", "Quarterly", and "Annual". Selecting ". When Blank, Monthly, Quarterly and Annual are chosen the button on cell to right needs to be removed or deleted. The code below locks down the cell but does not delete the button as required.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
Dim bu As Button
Set MyRange = Intersect(Range("C5:C133"), Target)
If Not MyRange Is Nothing Then
ActiveSheet.Unprotect Password:="CLS"
MyRange.Locked = True
If MyRange = "" Or MyRange = "Monthly" Or MyRange = "Quarterly" Or MyRange = "Annual" Then
For Each bu In ActiveSheet.Buttons
If bu.TopLeftCell.Address = ActiveCell.Offset(0, 1).Address Then bu.Delete
Next
End If
ActiveSheet.Protect Password:="CLS"
End If
End Sub
[/End Code]
Thank you in advance for any help
Biker57