VBA Code to avoid hard coded selection
Posted on 2012-04-05
below code inserts data validation into cells E3:E1450 of the active worksheet.
I do not want to hardcode the selection but check by means of VBA Code the number of Rows in COLUMN B first and insert that number into the second part of the Range ("E3:E1450").
Example: The number of columns / filled cells of column B is 1872. This number is to be transferred to the line of code where the Range (second part of the seclection) is selected, i.e.
Help is much appreciated. Thank you very much in advance.
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True