Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
For a custom dialogue box I was referred to the following excellent sample.
However, now that I have come across a situation in which a mistake took place, upon pressing the "Cancel" button the rest of the code still seems to be working! How to exit the code if e.g. Cancel button of: Application.InputBox(Prompt:="What is the price of house?", Type:=8) is pressed? Sub HCALC() HouseCalc _ Application.InputBox(Prompt:="What is the price of house?", Type:=8), _ Application.InputBox(Prompt:="What is your earning?", Type:=8) End Sub === Sub HouseCalc(price As Double, wage As Double) If wage < price Then MsgBox "With an excess of " & price - wage & " in the price you cannot afford this house.", , "SORRY!!!" Else MsgBox "With an excess earnings of " & wage - price & " this house is affordable.", , "YAHOO!!!" End If MsgBox "Your Earning Is " & wage & "!" & vbNewLine & "Whereas The House Costs " & price & "!", , "RESULT!!!" End Sub -- Best Regards, FARAZ A. QURESHI |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to modify the code for different type of input? | Excel Worksheet Functions | |||
How to modify the code for different type of input? | Excel Discussion (Misc queries) | |||
InputBox / VBA question ok = print, cancel = exit | Excel Worksheet Functions | |||
Input Box - CANCEL | Excel Worksheet Functions | |||
cancel input | Excel Discussion (Misc queries) |