I’m maintaining a piece of code and came across this in a VBA function:
isIn("Fred", [PeopleList])
Where PeopleList is a workbook named range. I’ve never noticed that syntax before and just wondered is it something I’ve missed or is it new? Should I pass in the range into the function or is this okay usage?
This [PeopleList] syntax is shorthand for Application.Evaluate(“PeopleList”) and it will try to evaluate PeopleList as a formula or named range and return the result as a variant containing an array. This usage is OK and has been available in VBA since Excel version 5.