odin1701
07-25-2008, 07:48 AM
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?
namliam
07-25-2008, 08:05 AM
isnumeric in access
isnumber in excel
Good luck !
odin1701
07-25-2008, 08:09 AM
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.
namliam
07-25-2008, 10:21 AM
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
odin1701
07-25-2008, 10:28 AM
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.
odin1701
07-25-2008, 10:29 AM
If a1 contains a text number then =Isnumber(a1) returns TRUE
Brian
In mine, it returns false when the format of the cell is set to text.
Brianwarnock
07-25-2008, 10:34 AM
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
namliam
07-25-2008, 10:32 PM
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...