Two of the worksheet-defined ranges in my spreadsheet are manipulated by macros that can either extend (as new entries are added) or contract (as entries are removed) the ranges. It is highly convenient to maintain these as separate ranges.
However, in the spreadsheet itself I also have a need to use the data validation function to refer to a list of names that is a combination of the two ranges. I assume the Union method is the way to do this. I have tried inserting the code below into the
macro that adds an entry to the list of payees, but I get a syntax error. I am probably committing some elementary error. This is the statement in VBA:
Set Range("namelist") = Application.Union(Range("payerlist"), Range("payeelist"))
VBA says that the first term - Range("namelist") - is an invalid use of property. Can someone please put me straight? (There may be other problems in what I have written, of course.)