[Still need] VBA help with Range and Cells methods
Posted by Tim Francis-Wright on August 18, 2000 8:42 AM
I thought so, too, but I still get the same error.
The NumTypes line works fine.
The TypeRange part works--only if
the Hidden sheet is activated.
Can I get this to work even if that sheet isn't active? (Another part of the code will really
work best if it can refer to another sheet
as the active sheet.)
Here's more of the code for the form:
For Each ThisControl in Me.Controls
With This Control
If .Name like "TypeCB*" then
' each control called TypeCB1 etc. is on a
' page of a multipage control
WhichPage = .Parent.Index + 1
NumTypes=Application.WorksheetFunction.HLookup( _
WhichPage, Range("IncomeTypes"), 2)
TypeRange = Sheets("Hidden").Range _
("IncomeTypes").Range(Cells(3, WhichPage), _
Cells(2 + NumTypes, WhichPage)).Address
' {snip}
End if
End With
Next