If [something is of the format of.....]

M

michael_mcclellan

Gentlemen and Ladies,

I'm trying to find the dates in a worksheet. How do I say something
like:


If Range("J" & ReportRowNum).Value [if of the format "mm/dd/yyyy" then
MyDate = Range("J" & ReportRowNum).Value

Thanks.
 
G

George Nicholson

How about:

If IsDate(Worksheets("Sheet1").Range("J" & ReportRowNum)) Then
.....

IsDate should return true for numbers formated as dates or text strings that
could be successfully evaluated as dates.

HTH,
George Nicholson

Remove 'Junk' from return address.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top