Hi
I have written a code to highlight lines of data given a date and time format and highlight it orange (this is a snapshot of the section that doesn't seem to work):
If rng.NumberFormat = "dd/mm/yyyy" Or rng.NumberFormat = "dd/mm/yy" Or rng.NumberFormat = "d-mmm-yy" Or rng.NumberFormat = "dd/mm/yyyy hh:mm" Or rng.NumberFormat = "dd/mm/yyyy h:mm" Then
cell.Offset(0, 0).Value = rng.Value
cell.Offset(0, 0).EntireRow.Interior.Color = RGB(200, 160, 35)
The script will identify dates with the format “10-jan-10” as an example and highlight it orange. However some lines in the data I am trying to work with are dates AND time such as “10/10/2011 09:11”. The codeis meant to identify this format and highlight it orange but it doesn’t work; i have no idea why? Can anybody tell me why this code will identify date but date&time?
all replies very much appreciated.
Thanks
Matt