ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Requesting user input for a number? (https://www.excelbanter.com/excel-programming/364849-requesting-user-input-number.html)

StargateFanFromWork[_3_]

Requesting user input for a number?
 
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



Bob Phillips

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






All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com