Hi,
In cell (A1) "Report Date:18-10-2015" Category General as data is from text file.
Macro to check this date with system date if wrong then alert message of wrong date.
Any help would be greatly appreciated!
Hi,
In cell (A1) "Report Date:18-10-2015" Category General as data is from text file.
Macro to check this date with system date if wrong then alert message of wrong date.
Any help would be greatly appreciated!
Sub blah() y = Split(Split(Range("A1").Value, ":")(1), "-") If DateValue(Join(Array(y(2), y(1), y(0)), "-")) = Date Then MsgBox "It IS today" Else MsgBox "It's not today!" End If End Sub
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
Why the double Split?
Wouldn't this work?Sub blue() y = Split(Range("A1").Value, ":") If DateValue(y(1)) = Date Then MsgBox "It IS today" Else MsgBox "It's not today!" End If End Sub
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Hi,
Thank you P45cal and SamT.
Because of a recent conversation (with you!) at http://www.vbaexpress.com/forum/show...l=1#post332203
DOH! How soon we (I) forget. Nice "universal" solution.
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ