View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default verifying data type

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.