View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Input Box Cancel function

Dim varTemp As Variant
Dim blnExit As Boolean

varTemp = InputBox("ENTER YOUR NAME - Press 'Enter' when done")
Range("B4") = varTemp
varTemp = InputBox("ENTER THE DATE YOU NEED THE FILE BY - Press 'Enter' when
done")
Range("C4") = varTemp
If Range("B4") = "" And Range("C4") = "" Then Rows(4).Delete: Exit Sub

If this post helps click Yes
---------------
Jacob Skaria


"Munchkin" wrote:

My input box works great when a user is filling in the info. But I also want
to give them the option to press cancel if they made a mistake & don't want
to proceed. If they press cancel I want Row 4 to be deleted & the macro to
end. How to I do that?


Range("B4") = InputBox("ENTER YOUR NAME - Press 'Enter' when done")
Range("C4") = InputBox("ENTER THE DATE YOU NEED THE FILE BY - Press
'Enter' when done")

Range("B4").Select