Test to determine if cell contains a number?

odin1701

Registered User.
Local time
Today, 17:23
Joined
Dec 6, 2006
Messages
526
I have a spreadsheet, and I have some formatting which is done to remove text lines after a certain point, etc.

Anyway I want a test to count how many rows start with a cell that contains a number. This is to be used as a control so as to compare the number before and after the program is run, and throw an error if they don't match up.

All rows with a number in column A will be kept.

Here's the catch - it's from a CSV file initially, and the numbers are stored as text.

Any test I can do?
 
isnumeric in access
isnumber in excel

Good luck !
 
Well...I'm guessing that would normally work.

Since it's a number stored as text, isnumber returns false.

oops...was typing something wrong.

Okay I think I can get it to work but I'll have to convert each cell to a number first.
 
Last edited:
Hmz, OK isnumber dont work in excel ?? !!

Try Integer(ref) tho
It will make either a number out of a number or create an error if it is not a number value
 
Hmz, OK isnumber dont work in excel ?? !!

Try Integer(ref) tho
It will make either a number out of a number or create an error if it is not a number value

No, no I was trying in VBA. I used IsNumeric and it actually works fine without converting the text cells to number cells.
 
Ok sorry I deleted my post rather than go into an explanation when I saw that you had got it working.
Excel confuses the hell out of people on text and numbers

eg If you type numbers into cells and then format the cells as text everything works fine,
but if the cells are already defined as text before entering the numbers then the data is stored as numbers stored as text and problems occur.

I temporarily forrgot this when originally posting.

Brian
 
No, no I was trying in VBA. I used IsNumeric and it actually works fine without converting the text cells to number cells.

VBA tho is less flexible than formulas...
 

Users who are viewing this thread

Back
Top Bottom