Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want my code to look at the contents of a cell, and if the contents are not
a number (any string) execute one set of code. If the contents are a number, skip over that code and continue on. I'm sure this can be easily done with an If Then statement, but I don't know how to test the data type of the contents of the cell. Could the .Type property be used? Any method for solving this would be appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like
If IsNumeric(Range("A1").Value) = True Then ' A1 is numeric Else ' A1 is not numeric End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "benb" wrote in message ... I want my code to look at the contents of a cell, and if the contents are not a number (any string) execute one set of code. If the contents are a number, skip over that code and continue on. I'm sure this can be easily done with an If Then statement, but I don't know how to test the data type of the contents of the cell. Could the .Type property be used? Any method for solving this would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Look up a value from a row after verifying two other values | Excel Worksheet Functions | |||
Verifying uniqueness of records in data | Excel Discussion (Misc queries) | |||
Verifying Dates | Excel Worksheet Functions | |||
Verifying all data in each row is filled in | Excel Programming | |||
verifying date | Excel Programming |