Assigning Values to an Array Position

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(n) = 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
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
As far as I can see Bonds isn't an array.:eek:

Neither is AllBonds, unless it's declared elsewhere.
 
Upvote 0
Bonds is a class defined in a class module elsewhere. I did a search through my code and finally found that i had mis-declared the array to begin with.

There will no doubt be more posts on this board as I continue this project--I've only been attempting to code for about a week now!

Thanks for the quick advice! Sorry to post a frivolous thread!
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,358
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top