ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   input box , msgbox, formula (https://www.excelbanter.com/excel-programming/294879-input-box-msgbox-formula.html)

lost

input box , msgbox, formula
 
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.



Juan Pablo González

input box , msgbox, formula
 
lost wrote:
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

--
Regards,

Juan Pablo González



Bob Phillips[_6_]

input box , msgbox, formula
 
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" wrote in message
...
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.





lost

input box , msgbox, formula
 
Thanks guys
That really helps
(no longer) Lost


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com