I am writing a code in excel (VBA) that involves creating a Data Validation list from a range of cells in the same sheet. However this range changes by size and by content.
Part of the code I am using pertained to data validation is found herein:
With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=RangeData .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With Where RangeData is the variable range that I defined earlier.
The first issue I have is with the RangeData, I am getting an error. I would like to know if there is an alternate way to specify the range. Please keep in mind that the range is frequently changing.
Second, I would like the macro to launch whenever I insert a new row in the table. I can't seem to work out how to do it.
Your responses are highly appreciated and thanks in advance for you time!

