D
Dick Watson
I have workbook named "ranges" that refer to things that aren't ranges of
cells.
E.g., MinWidthToSet refers to "=8" and RowsToTest refers to
"=COUNTA(MyRange)" (and these are simplified examples for discussion).
The problem comes in when trying to get a value for these from VBA since
they can't be found as default values of Range("MinWidthToSet") or
Range("RowsToTest").
I tried using Names("MinWidthToSet") which returns the string "=8"--I can
strip the "=" and CLng the remainder. Ugly but functional.
Bet there's no good way to do anything with the string "=COUNTA(MyRange)".
I've also tried Application.Evaluate "=RowsToTest" but this gets into all
kinds of ugly issues of the context in which the evaluation is done since
these are all scoped to specific sheets and multiple workbooks may be open
when this needs to be evaluated.
Is there a workaround to get the evaluated value of these names that aren't
cell ranges?
How does one define the complete context for an Application.Evaluate when
running code that belongs to a specific worksheet?
Thanks in advance!
cells.
E.g., MinWidthToSet refers to "=8" and RowsToTest refers to
"=COUNTA(MyRange)" (and these are simplified examples for discussion).
The problem comes in when trying to get a value for these from VBA since
they can't be found as default values of Range("MinWidthToSet") or
Range("RowsToTest").
I tried using Names("MinWidthToSet") which returns the string "=8"--I can
strip the "=" and CLng the remainder. Ugly but functional.
Bet there's no good way to do anything with the string "=COUNTA(MyRange)".
I've also tried Application.Evaluate "=RowsToTest" but this gets into all
kinds of ugly issues of the context in which the evaluation is done since
these are all scoped to specific sheets and multiple workbooks may be open
when this needs to be evaluated.
Is there a workaround to get the evaluated value of these names that aren't
cell ranges?
How does one define the complete context for an Application.Evaluate when
running code that belongs to a specific worksheet?
Thanks in advance!