Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to restart a code upon vbno
I have the following piece of code and want to restart the procedure if the
user inserts nothing OR zero in the first inputbox and then clicks "No" on the proceeding MsgBox. Please highlight, what is wrong with the code? Public Sub CNV() Dim check12 As Double check12 = Application.INPUTBOX (prompt:="Input Dollar Conversion Rate", Type:=1) If check12 Is Nothing Then fb = MsgBox("You have not inserted anything. You want to continue?", vbYesNo) If fb = vbYes Then ActiveCell = "=A1*" & check Else: GoTo check12 End If End If End Sub -- Best Regards, FARAZ A. QURESHI |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to restart a code upon vbno
Try this
Sub CNV() Dim c As Integer On Error GoTo ExitProc c = InputBox("Enter Value") ActiveCell = "=A1*" & c Exit Sub ExitProc: fb = MsgBox("You have not inserted anything. You want to continue?", vbYesNo) If fb = vbYes Then CNV If fb = vbNo Then Exit Sub End Sub |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to restart a code upon vbno
XCLENT!
By the way upon entering Zero the code continues. How 2 insert an OR condition to check whether the No value or Zero was inserted? -- Best Regards, FARAZ A. QURESHI "CurlyDave" wrote: Try this Sub CNV() Dim c As Integer On Error GoTo ExitProc c = InputBox("Enter Value") ActiveCell = "=A1*" & c Exit Sub ExitProc: fb = MsgBox("You have not inserted anything. You want to continue?", vbYesNo) If fb = vbYes Then CNV If fb = vbNo Then Exit Sub End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW TO RESTART COUNT FORMULA | Excel Discussion (Misc queries) | |||
HOW TO RESTART COUNT FORMULA | Excel Discussion (Misc queries) | |||
Won't restart after close | Excel Discussion (Misc queries) | |||
Can I break and restart a link in a macro | Excel Worksheet Functions | |||
Is there way to restart page numbering for each tab in worksheet | Excel Worksheet Functions |