Thread: Array of UDT
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jeremy Jeremy is offline
external usenet poster
 
Posts: 14
Default Array of UDT

Why not just make a Reader class and a custom Readers collection, and
then use the collection for whatever it is you're going for?

justahelper wrote:
I have defined the following:
Type reader
r_sname As String
r_name As String
r_restel As String
r_offtel As String
r_mobile As String
End Type

and am trying to use it in the following function:

Function GetReaderRecordsArray(rngTimeCell As Range) As readers()
Dim rngCommRng As Range
Dim u_readers() As reader
Dim bCommArr() As Boolean
Dim i As Integer
Dim j As Integer
Dim c_comm As Integer

Set rngCommRng = GetCommitRng(rngTimeCell)
bCommArr = GetCommFromCommitRng(rngCommRng)
c_comm = GetYesCountFromCommRng(bCommArr)

If c_comm 0 Then
ReDim u_readers(c_comm)

i = 0

For j = LBound(bCommArr) To UBound(bCommArr)
If bCommArr(j) Then
i = i + 1
u_readers(i) = GetReaderRecord(rngCommRng.Cells(j, 1))
Else
End If
Next j
End If
GetReaderRecordsArray = u_readers

End Function

I get a compile error msg. Can anyone help me fix this?