Some VB help please

Charlie

Board Regular
Joined
Mar 1, 2002
Messages
134
I am making a small prog that when finished will display the initial deposit of £1000,plus a rise of 5% simple interest and compound interest.
I want to display the amounts over a ten year period and the rise each year is 1.05 times larger than the deposit.
Ive done most of it, but have hit a stumbling block, can someone show me how to do the first year please.
Thanks
Charlie
Option Explicit

Private Sub cmdQUIT_Click()
'Terminate Application
End
End Sub

Private Sub cmdStart_Click()
'Declare required storage
Dim Initial_Dep As Currency
Dim Yr1 As Currency
Dim Yr2 As Currency
Dim Yr3 As Currency
Dim Yr4 As Currency
Dim Yr5 As Currency
Dim Yr6 As Currency
Dim Yr7 As Currency
Dim Yr8 As Currency
Dim Yr9 As Currency
Dim Yr10 As Currency

Initial_Dep = 1000

'Display result in pic box
picMessage.Print " The initial deposit was "; "£"; (Initial_Dep)
picMessage.Print "The first years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The second years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The third years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The fourth years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The fifth years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The sixth years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The seventh years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The eighth years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The ninth years amount plus interest is "; "£"; (Initial_Dep)
picMessage.Print "The tenth years amount plus interest is "; "£"; (Initial_Dep)




End Sub
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Does this look correct.Its the only way I can think of to do it.

Charlie

Option Explicit

Private Sub cmdQUIT_Click()
'Terminate Application
End
End Sub

Private Sub cmdStart_Click()
'Declare required storage
Dim Initial_Dep As Currency
Dim Yr1 As Currency
Dim Yr2 As Currency
Dim Yr3 As Currency
Dim Yr4 As Currency
Dim Yr5 As Currency
Dim Yr6 As Currency
Dim Yr7 As Currency
Dim Yr8 As Currency
Dim Yr9 As Currency
Dim Yr10 As Currency

Initial_Dep = 1000

'Display result in pic box
picMessage.Print " The initial deposit was "; "£"; (Initial_Dep)
picMessage.Print "The first years amount plus interest is "; "£"; (Initial_Dep * 1.05 + Initial_Dep)
picMessage.Print "The second years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 2))
picMessage.Print "The third years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 3))
picMessage.Print "The fourth years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 4))
picMessage.Print "The fifth years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 5))
picMessage.Print "The sixth years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 6))
picMessage.Print "The seventh years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 7))
picMessage.Print "The eighth years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * :cool:)
picMessage.Print "The ninth years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 9))
picMessage.Print "The tenth years amount plus interest is "; "£"; (Initial_Dep * 1.05 + (Initial_Dep * 10))




End Sub
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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