Friday
April 18, 2014

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

math! - george entered a function into his calculator andfound the following ...
VBA Programming - I'm trying to create a macro that asks for a loan between 1 ...
check! - Write a recursive formula that generates the terms of the following...
chemistry - I was way off on the other problem. But I see how you got the answer...
Computer Programming - I'm trying to create a vba code that solves this problem...
Math - If there is a recursively defined sequence such that a1 = sqrt(2) an + 1...
english - write the dependent clause and the subordinate conjunction 1)( If)sub...
alg2 (sequences) - how do i find the pattern for: -4,8,-12,16 if the last number...
math - is the answer to r2/3r-1/r-1/2 r7/6/r1
Chemistry - In a study of the following reaction at 1200K it was observed that ...

Search
Members