View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Input Box - CANCEL

Danny

I would tend to check for nothing entered or wrong data type entered.

Sub InputNumber()
selectnum = InputBox("What is the number?")
If selectnum = "" Or Not IsNumeric(selectnum) Then Exit Sub
Range("A1").Value = selectnum
End Sub


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 15:32:02 -0800, Danny
wrote:

Hi,

Please edit the macro below so when the user clicks on CANCEL or CLOSE the
box, Range A1 existing input won't change.

Sub InputNumber()
Range("A1").Value = InputBox("What is the number?")
End Sub

Thank you.