Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 206
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO RESTART COUNT FORMULA tgcali Excel Discussion (Misc queries) 3 April 21st 08 11:26 PM
HOW TO RESTART COUNT FORMULA akphidelt Excel Discussion (Misc queries) 0 April 21st 08 10:56 PM
Won't restart after close Markk Primack[_2_] Excel Discussion (Misc queries) 3 September 2nd 07 02:27 PM
Can I break and restart a link in a macro tweacle Excel Worksheet Functions 0 December 23rd 05 10:24 PM
Is there way to restart page numbering for each tab in worksheet michael Excel Worksheet Functions 1 June 1st 05 03:25 PM


All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"