cancel input

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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)
 
Back
Top