#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Numbers

Hello,

I am trying to figure out a way to prevent users from
entering a "not real" number into a text box. I tried to
ues an If statement.... If Not Isnumeric......
This doesn't seem to work. I had a user input "2345.45-"
with no error but excel igneroed the number in a
calculation. My users are bound to make many mistakes
and I would like to catch them at the time.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Numbers

Try using Application.IsNumber()

Even better is to set a cell to the text box value and then test the value
of the cell to see if the above is true. Why? Try 100%. If in a text box,
it is not a number. But if written to a cell, it is a number.

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jevul" wrote in message
...
Hello,

I am trying to figure out a way to prevent users from
entering a "not real" number into a text box. I tried to
ues an If statement.... If Not Isnumeric......
This doesn't seem to work. I had a user input "2345.45-"
with no error but excel igneroed the number in a
calculation. My users are bound to make many mistakes
and I would like to catch them at the time.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Numbers

Bob,

Another great tip from this ng. I knew about Application.IsNumber, but your
point about setting it to a cell is new to me. Now, if I can just find a
corner of my brain to stuff it in...

Thanks,

Doug Glancy

"Bob Flanagan" wrote in message
...
Try using Application.IsNumber()

Even better is to set a cell to the text box value and then test the value
of the cell to see if the above is true. Why? Try 100%. If in a text

box,
it is not a number. But if written to a cell, it is a number.

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jevul" wrote in message
...
Hello,

I am trying to figure out a way to prevent users from
entering a "not real" number into a text box. I tried to
ues an If statement.... If Not Isnumeric......
This doesn't seem to work. I had a user input "2345.45-"
with no error but excel igneroed the number in a
calculation. My users are bound to make many mistakes
and I would like to catch them at the time.

Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Numbers

Thanks, works perfectly!
-----Original Message-----
Try using Application.IsNumber()

Even better is to set a cell to the text box value and

then test the value
of the cell to see if the above is true. Why? Try

100%. If in a text box,
it is not a number. But if written to a cell, it is a

number.

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros

for Excel

"Jevul" wrote in

message
...
Hello,

I am trying to figure out a way to prevent users from
entering a "not real" number into a text box. I tried

to
ues an If statement.... If Not Isnumeric......
This doesn't seem to work. I had a user

input "2345.45-"
with no error but excel igneroed the number in a
calculation. My users are bound to make many mistakes
and I would like to catch them at the time.

Thanks



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel change a group of positive numbers to negitive numbers Clare Jones Excel Discussion (Misc queries) 3 July 2nd 09 04:25 PM
Excel 2002 : Convert Positive Numbers to Negative Numbers ? Mr. Low Excel Discussion (Misc queries) 2 November 6th 06 03:30 PM
Excel Formula - Add column of numbers but ignore negative numbers view for Distribution List members Excel Worksheet Functions 1 April 7th 06 03:13 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"