Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have already recieved some help on this one, but now if the user hits the cancel button or enters no value it results in an error/ debug box
I would like it to exit the macro when the cancel button is pressed, and if a value is not entered to display a msgbox telling you that a value was not entered Can you help me with an if statement or on error line Here is what I have Sub standard1( fconc = InputBox("Enter final conc. (ug/ml or ng/ul)" fvol = InputBox("Enter final volume (ml)" sconc = InputBox("Enter conc. of standard (ug/ml or ng/ul)" MsgBox Format(fconc * fvol / sconc, "#,##0.00") & " ul End Su Thanks in advanc |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try something like Dim fconc fconc = application.InputBox("Enter final conc. (ug/ml or ng/ul)") if fconc = False then msgbox "Cancel was hit" exit sub end if '... -- Regards Frank Kabel Frankfurt, Germany lost again wrote: I have already recieved some help on this one, but now if the user hits the cancel button or enters no value it results in an error/ debug box. I would like it to exit the macro when the cancel button is pressed, and if a value is not entered to display a msgbox telling you that a value was not entered. Can you help me with an if statement or on error line? Here is what I have: Sub standard1() fconc = InputBox("Enter final conc. (ug/ml or ng/ul)") fvol = InputBox("Enter final volume (ml)") sconc = InputBox("Enter conc. of standard (ug/ml or ng/ul)") MsgBox Format(fconc * fvol / sconc, "#,##0.00") & " ul" End Sub Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub standard1()
fconc = InputBox("Enter final conc. (ug/ml or ng/ul)") fvol = InputBox("Enter final volume (ml)") sconc = InputBox("Enter conc. of standard (ug/ml or ng/ul)") If fconc = "" Or fvol = "" Or sconc = "" Then Exit Sub End If MsgBox Format(fconc * fvol / sconc, "#,##0.00") & " ul" End Sub - Piku -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks guys, I keep getting hung up on proper "wording"
You were both a great hel Thanks again!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with InputBox and MsgBox | Excel Discussion (Misc queries) | |||
Help with InputBox and MsgBox | New Users to Excel | |||
msgbox / inputbox etc | Excel Discussion (Misc queries) | |||
msgbox / inputbox etc | Excel Worksheet Functions | |||
msgbox / inputbox etc | Setting up and Configuration of Excel |