Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verify Cell Value is a Date

Status
Not open for further replies.

tudor30

Technical User
Jan 7, 2004
49
US
I need to look down a column of data and verify the entry is a date.

Thanks for assistance,
John

 
Take a look at the IsDate function.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
'change the value of c in line 4 to match the col. you need

Sub check_dates()
Dim r As Integer
Dim c As Integer
r = 1: c = 1 'change c to correspond to your column
Do Until Cells(r, c) = ""
If IsDate(Cells(r, c)) = False Then
MsgBox ("cell " + Cells(r, c).Address + " is not of a date format")
Else
End If
r = r + 1
Loop
End Sub
 
Thanks ETID. That worked very well!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top