I have the following code that won't work.
Ideally, I would like for any cell in column Q in the chart to toggle values from "" to "P" upon selection. Also I need Range("L5") to toggle 5 different values upon selection
Please see code below.
Any help on why this isn't working would be greatly appreciated.
Thanks in advance.
Ideally, I would like for any cell in column Q in the chart to toggle values from "" to "P" upon selection. Also I need Range("L5") to toggle 5 different values upon selection
Please see code below.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Protect UserInterfaceOnly:=True
With Target
If Intersect(.Cells, Columns(17)) Is Nothing Or Intersect(.Cells, Worksheets("Sheet1").Range("L5")) Is Nothing Or .Count > 1 Then Exit Sub
Select Case .Value
Case ""
Worksheets(1).Unprotect Password:=""
.Value = "P"
Worksheets(1).Protect Password:=""
Case "P"
Worksheets(1).Unprotect Password:=""
.Value = ""
Worksheets(1).Protect Password:=""
Case "Store Pick-up"
Worksheets(1).Unprotect Password:=""
.Value = "HQ Shipping"
Worksheets(1).Protect Password:=""
Case "HQ Shipping"
Worksheets(1).Unprotect Password:=""
.Value = "Store Shipping"
Worksheets(1).Protect Password:=""
Case "Store Shipping"
Worksheets(1).Unprotect Password:=""
.Value = "Supplier Drop Ship"
Worksheets(1).Protect Password:=""
Case "Supplier Drop Ship"
Worksheets(1).Unprotect Password:=""
.Value = "Store Pick-up"
Worksheets(1).Protect Password:=""
Exit Sub
Case Else
Exit Sub
End Select
End With
Cancel = True
Application.EnableEvents = True
Worksheets(1).Protect Password:=""
End Sub
Any help on why this isn't working would be greatly appreciated.
Thanks in advance.
Last edited by a moderator: