Not that I can think of, but if its not too late, if your Type as
several values it could be replaced with a class.
I created a sample class called MyClass. Play close attention to the
"Set" command.
+++++ Start of MyClass +++++
Option Explicit
Private firstValue As Long
Private secondValue As Single
Private thirdValue As Range
Public Property Let SetFirstValue(lValue As Long)
firstValue = lValue
End Property
Public Property Let SetSecondValue(sValue As Single)
secondValue = sValue
End Property
Public Property Set SetThirdValue(rValue As Range)
Set thirdValue = rValue
End Property
Public Property Get GetFirstValue() As Long
GetFirstValue = firstValue
End Property
Public Property Get GetSecondValue() As Single
GetSecondValue = secondValue
End Property
Public Property Get GetThirdValue() As Range
Set GetThirdValue = thirdValue
End Property
Public Sub SetAll(lValue As Long, sValue As Single, rValue As Range)
firstValue = lValue
secondValue = sValue
Set thirdValue = rValue
End Sub
+++++ End of MyClass +++++
And a module to create and access the instances of class
+++++ Start of Module +++++
Option Explicit
Sub Test()
Dim myItem As MyClass
Dim myCollection As Collection
Set myCollection = New Collection
Set myItem = New MyClass
myItem.SetFirstValue = 1&
myItem.SetSecondValue = 2!
Set myItem.SetThirdValue = Range("A1")
myCollection.Add Item:=myItem, key:="one"
Set myItem = New MyClass
myItem.SetFirstValue = 3&
myItem.SetSecondValue = 4!
Set myItem.SetThirdValue = Range("B2")
myCollection.Add Item:=myItem, key:="two"
Set myItem = New MyClass
myItem.SetAll 5&, 6!, Range("C3")
myCollection.Add Item:=myItem, key:="three"
Set myItem = myCollection("two")
MsgBox myItem.GetSecondValue
Set myItem = myCollection("three")
MsgBox myItem.GetThirdValue.Address
Set myCollection = Nothing
End Sub
+++++ End of Module +++++
It may seem like a lot of typing to create something as simple as the
Type but its much more flexible in future developement.
I personally do not use arrays or types too much since what is a
Spreadsheet but a two dimensional array, each row or record can have 256
distinct values.
*** Sent via Developersdex
http://www.developersdex.com ***