blairintern
New Member
- Joined
- Jul 16, 2007
- Messages
- 21
I am having trouble assigning data into an array of a custom class which I have created. The program is designed to output bond information in a visual format.
I have recieved the following error: "Compile Error: Sub or Function not Defined"
The code is as follows:
Sub MakeIssue()
Dim i As Integer ' indicates the index of the loop
Dim n As Integer ' indicates what issue loop is on
i = 0
n = 1
Dim Bonds As IssueClass
Bonds = New IssueClass
Sheets("Input").Range("A1").Select
Do
With Sheets("Input").ActiveCell.Range("A1")
If .Offset(i, 0) Is Nothing Then
i = i + 1
Else
Bonds = New IssueClass
Bonds.Purpose = .Offset(i, 2) & " " & .Offset(i, 4) _
& " " & .Offset(i, 5)
Bonds.DatedDate = .Offset(i, 0)
Bonds.Series = .Offset(i, 3)
Bonds.Par = .Offset(i, 7)
Bonds.CallDate = .Offset(i, 8)
Bonds.CallPrice = .Offset(i, 9)
Bonds.Moody = .Offset(i, 11)
Bonds.SandP = .Offset(i, 12)
Bonds.Fitch = .Offset(i, 10)
Bonds.Underwriter = .Offset(i, 16)
Bonds.Counsel = .Offset(i, 17)
' Bonds.Refunded = .Offset(i, 19)
Bonds.Insurance = .Offset(i, 26) ' not yet on form
Set AllBonds = Bonds <--error here
Next n
Next i
End If
End With
Loop Until ActiveCell.Range("A1").Offset(i, 0).Value = "Session Det"
End Sub
The IssueClass is what is going into the array called Bonds.
Thanks in advance
I have recieved the following error: "Compile Error: Sub or Function not Defined"
The code is as follows:
Sub MakeIssue()
Dim i As Integer ' indicates the index of the loop
Dim n As Integer ' indicates what issue loop is on
i = 0
n = 1
Dim Bonds As IssueClass
Bonds = New IssueClass
Sheets("Input").Range("A1").Select
Do
With Sheets("Input").ActiveCell.Range("A1")
If .Offset(i, 0) Is Nothing Then
i = i + 1
Else
Bonds = New IssueClass
Bonds.Purpose = .Offset(i, 2) & " " & .Offset(i, 4) _
& " " & .Offset(i, 5)
Bonds.DatedDate = .Offset(i, 0)
Bonds.Series = .Offset(i, 3)
Bonds.Par = .Offset(i, 7)
Bonds.CallDate = .Offset(i, 8)
Bonds.CallPrice = .Offset(i, 9)
Bonds.Moody = .Offset(i, 11)
Bonds.SandP = .Offset(i, 12)
Bonds.Fitch = .Offset(i, 10)
Bonds.Underwriter = .Offset(i, 16)
Bonds.Counsel = .Offset(i, 17)
' Bonds.Refunded = .Offset(i, 19)
Bonds.Insurance = .Offset(i, 26) ' not yet on form
Set AllBonds = Bonds <--error here
Next n
Next i
End If
End With
Loop Until ActiveCell.Range("A1").Offset(i, 0).Value = "Session Det"
End Sub
The IssueClass is what is going into the array called Bonds.
Thanks in advance