Quote:
For example, if I selected A101:A103, This macro would add a validation list in A100, including values of A101:A103.
|
Code:
Sub testing()
With Selection.Cells(1).Offset(-1).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=" & Selection.Address
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub