input box , msgbox, formula

L

lost

Hey all, still quite a newbie here.
I need to create something that calculates values entered into input boxes and displays them in a msgbox.
This is what I have so far:
Sub standard1()

fconc = InputBox("Enter final conc.")
fvol = InputBox("Enter final volume")
sconc = InputBox("Enter conc. of standard")

MsgBox = "fconc*fvol/sconc"

End Sub

Of course I ge an error at the msgbox line because I don't know what I'm doing, but that is the formula I need..fconc x fvol / sconc.
Any help would be greatly appreciated.
Thanks,
Lost.
 
J

Juan Pablo González

lost said:
Hey all, still quite a newbie here.
I need to create something that calculates values entered into
input boxes and displays them in a msgbox.
This is what I have so far:
Sub standard1()

fconc = InputBox("Enter final conc.")
fvol = InputBox("Enter final volume")
sconc = InputBox("Enter conc. of standard")

MsgBox = "fconc*fvol/sconc"

End Sub

Of course I ge an error at the msgbox line because I don't know what
I'm doing, but that is the formula I need..fconc x fvol / sconc. Any
help would be greatly appreciated.
Thanks,
Lost.

Remove the quotes in the MsgBox, as in:

MsgBox = fconc * fvol /sconc
 
B

Bob Phillips

Hi Lost,

This what you want

fconc = InputBox("Enter final conc.")
fvol = InputBox("Enter final volume")
sconc = InputBox("Enter conc. of standard")

MsgBox "Value is " & fconc * fvol / sconc


if you want to format it, try

fconc = InputBox("Enter final conc.")
fvol = InputBox("Enter final volume")
sconc = InputBox("Enter conc. of standard")

MsgBox "Value is " & Format(fconc * fvol / sconc, "#,##0.00")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

lost said:
Hey all, still quite a newbie here.
I need to create something that calculates values entered into input
boxes and displays them in a msgbox.
This is what I have so far:
Sub standard1()

fconc = InputBox("Enter final conc.")
fvol = InputBox("Enter final volume")
sconc = InputBox("Enter conc. of standard")

MsgBox = "fconc*fvol/sconc"

End Sub

Of course I ge an error at the msgbox line because I don't know what I'm
doing, but that is the formula I need..fconc x fvol / sconc.
 
Top