Help with Range and Cells methods
Posted by Tm Francis-Wright on August 15, 2000 10:57 AM
I'm trying to get a userform to set up
a combobox contents from a lookup table
on a worksheet. I want this worksheet
to be hidden from the user, who will
have another sheet activated.
(The VBA code for the userform uses variables
in place of the 3 and 5 below.)
How can I access the range without activating
the hidden sheet? What am I doing wrong?
Thanks, Tim F-W
Here's the results from the Immediate pane:
debug.Print range("incometypes").name
=Hidden!$A$104:$F$111
'with worksheet called "Hidden" activated
debug.Print Range("incometypes"). _
Range(Cells(3,1),cells(5,1)).Address
$A$106:$A$108
'with some other worksheet activated
debug.Print Range("incometypes"). _
Range(Cells(3,1),cells(5,1)).Address
[yields Run-Time error '1004":
application-defined or object-defined error]