View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default Requesting user input for a number?

Dim ans As Variant

ans = InputBox("add number")
If ans < "" Then
Range("M10").Value = ans
End If


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"StargateFanFromWork" wrote in message
...
I found code in the archives that works in that it requests a number and
then inputs that number into a cell. However, it doesn't have a cancel

and
I haven't had luck getting anything to work for that. Since this code

isn't
specifically for this simple purpose even though I was able to modify it,
however, it is probably better to start from scratch with code

specifically
for this purpose.

So, the box should request the user input a number cell B4 but should have
nothing happen if the user presses cancel.

Thanks much! :oD