Conditionally Converting Text to Numbers in VBA

J

Jon

Our database program exports a column of data as text.

This column includes general text (e.g. Summer), numbers (2002), and
dates (AUG 03).

If I were using excel formulas, I'd simply do the following

=if(iserr($b2+0),$b2,$b2+0)

and copy the formula down. Excel then happily converts dates and
numbers and I can use these thereafter.

How can I do the same in VBA, but referencing by cell rather than
range? (I'm looping down using a numeric row counter,
=cells(rowcounter, 2) )

Any help would be appreciated.

Thanks
 
Top