ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check a column for correct type of data (https://www.excelbanter.com/excel-programming/375478-check-column-correct-type-data.html)

TWilson

Check a column for correct type of data
 
I have a worksheet that has to have dates manually inputted where I then have
my own macro do some other stuff. Is there a way to check the A column for
date data and have a box popup telling them if they havent while also
stopping the macro?

Thanks

Don Guillett

Check a column for correct type of data
 
one way

Sub checkdate()
For Each c In Selection
On Error Resume Next
If Not IsDate(c + 1) Then MsgBox c.Address '"not a date"
Next
End Sub


--
Don Guillett
SalesAid Software

"TWilson" wrote in message
...
I have a worksheet that has to have dates manually inputted where I then
have
my own macro do some other stuff. Is there a way to check the A column
for
date data and have a box popup telling them if they havent while also
stopping the macro?

Thanks





All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com