February 21, 2017

Homework Help: Vba

Posted by Dom on Monday, July 8, 2013 at 6:20am.

I'm trying to write a sub that asks how much oil I made, and then gives me number of barrels needed to hold oil, cost of producing oil, and profit from oil. This is what I have so far, I'm not sure what to do.

Sub Oil()

Dim barrels As Variant
Dim tons As Integer

InputBox "How many tons of oil were produced?"

Barrels = Gallons / 10
cost = 0.38 * Barrels
profit = 0.27 * Barrels

MsgBox "" & Barrels & " barrels needed to hold milk"
MsgBox "Cost of producing oil = " & cost & ""
MsgBox "Profit of producing oil = " & profit & ""
End Sub

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions