I am adding a data validation list box to an existing Excel spreadsheet. The data is coming from a separate sheet called Data. The range for the data is A4 - A100; so far data is only in cells A4 - A10.
When activating the Data Validation List box it is reading all the blank cells. Is there a way to stop this?
My code so far:
''Code below is what I am using to create the list box
With Range("A21:A42").Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Data!$A$4:$A$100"
End With
I know that when creating Data Validation directly in Excel it's a tick box to ignore blank cells.