Hi,
I have a named range (i.e. RangeNameThatContainsSheetName) that contains a string.
This string contains a worksheet name.
In VBA, I used the following 2 formulas to obtain the string stored in that named range.
Option 1:
SheetName = Range("RangeNameThatContainsSheetName").Value
Option 2:
SheetName = ThisWorkbook.Names("RangeNameThatContainsSheetName").RefersToRange.Value
Both options work fine.
Note: in my function the first one will execute faster than the second one.
However, I wonder what is really the difference between the two...
Any suggestions when to use and not to use each option?
In advance, thank you.
Jack
I have a named range (i.e. RangeNameThatContainsSheetName) that contains a string.
This string contains a worksheet name.
In VBA, I used the following 2 formulas to obtain the string stored in that named range.
Option 1:
SheetName = Range("RangeNameThatContainsSheetName").Value
Option 2:
SheetName = ThisWorkbook.Names("RangeNameThatContainsSheetName").RefersToRange.Value
Both options work fine.
Note: in my function the first one will execute faster than the second one.
However, I wonder what is really the difference between the two...
Any suggestions when to use and not to use each option?
In advance, thank you.
Jack