How do I reference a named range on the ActiveSheet using VBA? I have several worksheets, each with a named range that uses the same title. None of the below work:
ActiveSheet.NamedRange
ActiveSheet!NamedRange
You need to use:
ActiveSheet.Range("myNamedRange")
or just
Range("myNamedRange")
it's the same for ActiveSheet
If you need to get named range from another worksheet, use following code:
Worksheets("Sheet1").Range("myNamedRange")
You may also reference it by bracket, example:
[my_table]
or
ActiveSheet.[my_table]
and you avoid using the quotation marks.