I am using a Worksheet_SelectionChange event to populate a cell with a drop-down based on the selection in the adjacent cell
I am having a problem with the Formula1 line where the (dynamic) named range in a different worksheet is applied.
Sometime this works (I can't work out why it works when it does work), but the majority of times it doesn't work.
I have tried to create a string that includes all the items in the dynamically established list but that didn't work either.
Any pointers anyone?
TIA
VBA Code:
With Selection.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=D_FDBFSTypes"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "ERROR"
.InputMessage = ""
.ErrorMessage = "Make a selection from the drop-down list only"
.ShowInput = False
.ShowError = True
End With
Sometime this works (I can't work out why it works when it does work), but the majority of times it doesn't work.
I have tried to create a string that includes all the items in the dynamically established list but that didn't work either.
Any pointers anyone?
TIA