Re: Array of UDT



What version of XL / VBA are you using?

Does the compiler highlight a particular line as the offending line?

At the very least you should change the return type of the function from
readers() to reader()

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <A5859C76-32E3-4C58-9108-7159A8E62DA7@xxxxxxxxxxxxx>,
justahelper@xxxxxxxxxxxxxxxxxxxxxxxxx says...
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?


.



Relevant Pages

  • Re: SqlDataReader Function From a VB6 refugee
    ... Also the Reader is for connected operations i.e. the underlying connection ... Shared Function Create_SQL_DataReader(ByVal sDate As String) As ... Dim SQLConn As New SqlConnection ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Array of UDT
    ... reader and not reader ... Excel, PowerPoint, and VBA add-ins, tutorials ... r_sname As String ... Dim rngCommRng As Range ...
    (microsoft.public.excel.programming)
  • Re: Array of UDT
    ... "Tushar Mehta" wrote: ... readers() to reader ... r_sname As String ... Dim rngCommRng As Range ...
    (microsoft.public.excel.programming)
  • Re: Array of UDT
    ... readers() to reader ... r_sname As String ... Dim rngCommRng As Range ... Dim bCommArr() As Boolean ...
    (microsoft.public.excel.programming)
  • Search pattern
    ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
    (comp.databases.ms-access)