I hit the wrong key & posted B4 finishing. Gotta remember not to use
Tab while posting. Full post below:
VBA has a way to tell the type of data in a cell. It is TypeName
Here's a code snippit of mine:
> If TypeName(ActiveSheet.Cells(r, 1).Value) <> "Double" Then
> ' If non-number, abort
> Debug.Print " - - - no frequency - - -"
> Else ' Belongs to TypeName
> Debug.Print " - frequency present -"
> f = ActiveSheet.Cells(r, 1) ' Fet the freauency and...
Then I work on the number in the cell.
End If
End Sub
I'm looking in col A(1) of the currently selected row (r) for a
number (Aafrequency). If it isn't a Double float (aparently the
default Type when entering numbers from the KBD), then I abort the
routine.
A type of "String" will get you, you guessed it, a string entry. In
your case you need something like:
If TypeName(The cell youre looking in) = "String" Then
Do the delete
Else
Don't delete
End If