Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning an array into Excel from a form....NEED HELP, PLZ :)

Status
Not open for further replies.

swiff

Technical User
Apr 28, 2001
2
AU
Ok, I hope some1 can help me...

I've formed an array from a form, and the values appear correctly on the msgbox's that I have done...

But I don't know how to pass on those values into excel into a report....

Can some1 help me...

I have the troubled code here:
----------------------------
Public Function bank()

initial = UserForm1.bal.Value
irate = UserForm1.rate.Value
years = UserForm1.years.Value

Dim Output()

ReDim Output(1 To years)

For i = 1 To years

balance = initial * (irate / 100)

Output(i) = balance + initial

MsgBox "balance is " & Output(i)

initial = Output(i)

Next i

bank = Output

End Function

-------------------------------------
Then I have the "OK" button on the form
______________________________________

Public Sub CommandButton2_Click()

Dim i

For i = LBound(bank) To UBound(bank)
????????
Next

UserForm1.Hide


End Sub

-------------------------------

Is this partly correct... as what I need to do is return the values of the array into cells in Excel.

Can this be done?????????

Thanks sooo much for your Time...

Jacintha
 
Jacintha,
Yes it can be done. Does this information need to go into specific cells or are you just creating a new Excel workbook and dumping the data into it???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top