View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Need Input Box to only Accept Numeric Values

if isnumber(X) then

I think you mean isnumeric(x) or application.isnumber(x)


"zz" wrote:

see if this work:


x=inputbox("the prompt","the title")
if isnumber(X) then
all_correct
else
start_from_beginning_and_this_time_write_it_well
end if

--

---
Zz

wrote in message
oups.com...
Help! I need a way to only allow numeric values to be accepted by an
input box. My code starts with


inputNum = InputBox("Please enter the part number", "Part Number",
0)
x = Val(inputNum)


I'm using a vlookup to make sure a input number is valid, but not sure
how to go about it if letters were input. The program should not go
any further if an alpha string is entered. How do I check for this??

Thank you!