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
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