cancel input

G

Guest

have the following line of code

Dim reg As String
Range(locatereg).Select

reg = InputBox("Confirm Registration Number For " & Range(locatetrunk) &
Chr$(13) & Chr$(13), "Reg", Range(locatereg))

how do i get the imput box to exit the sub if cancel is pressed,, as it does
if using msgbox
 
B

Bob Phillips

Dim reg As String
Range(locatereg).Select

reg = InputBox("Confirm Registration Number For " & _
Range(locatetrunk) & vbNewLine & vbNewLine, _
"Reg", Range(locatereg))

If reg <> "" Then
...


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top