ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Numerical Input via an inputbox method (https://www.excelbanter.com/excel-programming/307121-re-numerical-input-via-inputbox-method.html)

Tom Ogilvy

Numerical Input via an inputbox method
 
Sub tester2()
Dim myNum As Long
myNum = Application.InputBox("Enter a Number", Type:=2)

ActiveCell.Value = myNum
End Sub


works for me. You need to use a data type that will hold a number of that
size (for a whole number, use long).

--
Regards,
Tom Ogilvy

"RBBCPA" wrote in message
...
I am trying to write a macro with an inputbox that allows a user to input

a
number and then put that number in a given cell so that it can be used in
calculations (outside the macro). the code I am using is shown below. I
copied from a posted article on the microsoft site. the problem is that

when
i enter a number larger than 32600, i get a run-time '6' error overflow.

i
can't figure out why. i want to be able to enter numbers between 1000000

and
10000000





All times are GMT +1. The time now is 01:27 PM.

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