Define a user type? Would you kindly give me a short example? Thanks!!!!
The Type declaration is placed in the (General)(Declarations) section of the code window... that is, at the top of the code window, but not inside any Sub or Function procedures. You can have more than one Type declaration if needed, just give them different names. Here is an example...
Type MyType
First As String
Second As Double
Third As Long
Fourth As String
Fifth As Long
End Type
MyType is an example name for the Type block... you can give it any name you want (follow the naming rules for variables). The First, Second, Third, Fourth and Fifth are example variable names... you can call your Type elements by any (legal variable) name you want. Remember, the above declaration is done outside of any procedures. Inside a procedure, you would declare your variable or array to be of the name you gave your Type. So, if you wanted to declare an array of 3 elements of this Type, your declaration could look like this...
Dim MyArray(1 To 3) As MyType
Then, to assign values to the Type elements, you could do something like this...
MyArray(1).First = "Hello"
MyArray(1).Second = 1.23
MyArray(1).Third = 12345678
MyArray(1).Fourth = "Good-bye"
MyArray(1).Fifth = 987654
MyArray(2).First = "Aloha"
MyArray(3).Second = 9.8765
etc.
You might also find the VB help files useful. Type the word "type" into the Immediate Window and, with the text cursor in or next to the word, press F1 and select the VBA entry from the popup menu that appears.