problem:Structure with Object reference (TYPE...END TYPE)
All objects of any type (including Range) need to be set first. (as I showed
you in my code).
--
Regards,
Tom Ogilvy
"syswizard" wrote:
Thanks guys for the help...just when I thought I was getting good at
this.....NOT !!
Strangely, I scoured the entire net look for someone who had used an
object within a TYPE using Excel. None, nada, zip to be found.
As an interesting aside, when you have an object within a TYPE
structure,
you cannot reference it directly from the structure. It must be "set"
first.
Assuming TD is the structure reference.
Dim xRange As Range
Set xRange = TD.TestRange
dTotal = dTotal + TD.TestRange.Cells.Offset(ix).Value <= Fails !!!
dTotal = dTotal + xRange.Cells.Offset(ix).Value <= Works Fine !!!
I wonder if that would not be the case had I used a RANGE in the
structure instead of OBJECT ?
|