• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data Validation similar to the userform Combobox

S P P

Member
Data Validation similar to the userform Combobox Example
 

Attachments

  • Data Validation similar to the userform Combobox Example.xlsm
    22.9 KB · Views: 7
Attached
 

Attachments

  • Chandoo58183Data Validation similar to the userform Combobox Example.xlsm
    30.1 KB · Views: 1
Thank you for your collaboration

It is not the same as the Userform

If validation has no letter selected
A
B
C
D
If the validation is with the Letter
A
Only with option to select
B
Or Viceverse
If the validation is with the Letter
C
Only with option to select
D
Or Viceverse
If Delete will display
A
B
C
D

OFFICE 2019
 
When protecting is not working.
If you unprotect and delete it, it works again
 

Attachments

  • Chandoo58183Data Validation similar to the userform Combobox Example1.xlsm
    27.7 KB · Views: 2
Don't know. When you delete a cell on a protected sheet, the data validation seems to be deleted too, but not on an unprotected sheet.
 
Maybe:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim DVCells As Range
Set DVCells = Intersect(Target, Range("Tabela13[Status]"))
If Not DVCells Is Nothing Then
  On Error Resume Next
  Me.Unprotect
  For Each cll In DVCells
    Select Case cll.Value
    Case "A": VD = "B"
    Case "B": VD = "A"
    Case "C": VD = "D"
    Case "D": VD = "C"
    Case Else: VD = "A,B,C,D"
    End Select
    With cll.Validation
      .Delete
      .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=VD
    End With
  Next cll
  Me.Protect
End If
End Sub
 
Back
Top