Use the dummy symbol method for cell B9 . This installs DV:
Sub InternalString2() Range("B9").Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=Replace("alpha%ralpha,beta%waiter,gamma%hammer,delta%faucet","%",Chr(130)) .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = False End With End Sub
where Chr (130) is fictitious . Important .ShowError
.
Now, to replace the dummy , we use the event macro:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("B9")) Is Nothing Then Exit Sub Application.EnableEvents = False Range("B9").Replace What:=Chr(130), Replacement:="," Application.EnableEvents = True End Sub
source share