I am working on a application and have had great difficulty with this calculation.
This has a choice of 2 seasons for rates
the first is standard. It is the second one I need a hint with.
when selected a clacualtion needs to take place.
if txtKilowatt = 0 then the cost equals a flat rate of 10.00 assigned to txtCost.text
basic flat rate of $10.00 regardless of usage (even 0 kilowatthours)
or if txtKilowatt<= 400 then rate = .08 per kilowatt
or if txtKilowatt>= 401 and less than 800 then rate = .06 per kilowatt
or if txtKilowatt>= 800 then rate = .04 per kilowatt
The values are calculated as follows eg.
txtKiloWatt.text = 850
8 cents per kilowatthour for the 1st 400 kilowatt-hours used
6 cents per kilowatthour for 401 to 800 (8 cents for the 1st 400)
and 4 cents per kilowatthour for 801 and above (plus the 8 and 6)
Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC. I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code.