Wednesday
May 27, 2015

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

Related Questions

Members