I use named ranges a lot both to identify particular ranges on a sheet, and as markers to identify certain properties of a sheet so that when an auto command happens, it can tailor what it does for the sheet.
I have got to the stage whereby I cannot rely on a range - or individual cell - not having more than 1 name. Certainly for Excel 2010, it looks like the range object does not have the collection property 'Names'. It has the property Name, but not Names. If there is more than 1 name for a cell/range, then it appears to assign the first alphabetic name to the range 'name' property.
This is causing me an issue as ideally I need to test a cell when selected to quickly see whether the name of the cell/range matches a certain format. If there is more than 1 name for the cell I clearly need to see if either/any of the names match this format. This does not appear to be simple as I have no way of knowing if there is more than 1 name for the range.
I have other solutions such as checking all the names on the worksheet to see which ones match with the current cell/range, but there are many names and this does add delay into the process. The quickest I can do it is to see if the cell has a name, if so and it doesn't match the format, then go do a full scan of names for the worksheet to see if any are for the cell and match the name format.
Does anyone have any ideas? Such as whether you can [quickly] see if there are more than 1 names for the cell/range; or perhaps a novel way of more quickly testing the names in the sheet?
Thanks
I have got to the stage whereby I cannot rely on a range - or individual cell - not having more than 1 name. Certainly for Excel 2010, it looks like the range object does not have the collection property 'Names'. It has the property Name, but not Names. If there is more than 1 name for a cell/range, then it appears to assign the first alphabetic name to the range 'name' property.
This is causing me an issue as ideally I need to test a cell when selected to quickly see whether the name of the cell/range matches a certain format. If there is more than 1 name for the cell I clearly need to see if either/any of the names match this format. This does not appear to be simple as I have no way of knowing if there is more than 1 name for the range.
I have other solutions such as checking all the names on the worksheet to see which ones match with the current cell/range, but there are many names and this does add delay into the process. The quickest I can do it is to see if the cell has a name, if so and it doesn't match the format, then go do a full scan of names for the worksheet to see if any are for the cell and match the name format.
Does anyone have any ideas? Such as whether you can [quickly] see if there are more than 1 names for the cell/range; or perhaps a novel way of more quickly testing the names in the sheet?
Thanks