check column for numeric data and send alert

Microsoft Excel 2002 (full product)
September 13, 2010 at 11:11:28
Specs: Windows XP sp3, 3.06 GHz, 512 MB of RAM
I have a macro that populates a certain column that needs to be checked to make sure all the data in the column is numeric in value. How could I stop the macro if all the data in a column is NOT numeric and send an alert (such as an email or text message to my phone)? Does anyone have any ideas on this?



See More: check column for numeric data and send alert

Report •

September 13, 2010 at 11:54:23

If the macro is putting the data into the column - test the data before it is placed in the column.

Use IsNumeric():

If IsNumeric(YourData) Then
    'its numeric - so save it
    ActiveSheet.Range("A1").Value = YourData
    'its not numeric so send a message
    MsgBox "This is not a number"
End If

For emailing from Excel you can look at response #1 on this thread, or look at these articles on MSDN.


Report •
Related Solutions

Ask Question