Hi Excel Gurus,
I have created a macro for DATA Validation, in the code below there is range (Formula1:="=$F$2:$F$4"), instead of the range, I want to declare the list there itself like ("123","abcd","pokeman", etc). Request you please help me in this regard.
F2=123
F3=abcd
F4=pokeman
Sub Macro1()
With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$F$2:$F$4"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
I have created a macro for DATA Validation, in the code below there is range (Formula1:="=$F$2:$F$4"), instead of the range, I want to declare the list there itself like ("123","abcd","pokeman", etc). Request you please help me in this regard.
F2=123
F3=abcd
F4=pokeman
Sub Macro1()
With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$F$2:$F$4"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub