Hi, I'm Running Excel 2002. I have imported a series of dates from an SQL Database using MS Query.
In a reocrd, users of the Database can set any dates which are 'not applicable' to a record as "N/A". The database records this setting in the date field as the date '31/12/1901 00:00:00' (DD-MM-YYYY HH:MM:SS).
In Excel I format these date columns to be 'DD-MM-YY'.
I am running a simple macro to replace and dates of the format 'DD-MM-YY' with the string "N/A".
My problem is is that while Excel replaces the dates when I do a manual 'find/replace', when I run the recorded macro again with new data no dates are replaced!!
The code that is recorded directly from the macro which worked is:
Cells.Select
Selection.Replace What:="31-12-01", Replacement:="N/A", LookAt:=xlWhole _
, SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False
Buy doesn't work when run!
Any help on this would be greatly appreciated!
I have tried replacing the 'What:=" criteria with the formats "DD-MM-YY", "DD-MM-YYYY", "DD-MM-YYYY HH:MM:SS" to no avail.
Thanks,
Richard
In a reocrd, users of the Database can set any dates which are 'not applicable' to a record as "N/A". The database records this setting in the date field as the date '31/12/1901 00:00:00' (DD-MM-YYYY HH:MM:SS).
In Excel I format these date columns to be 'DD-MM-YY'.
I am running a simple macro to replace and dates of the format 'DD-MM-YY' with the string "N/A".
My problem is is that while Excel replaces the dates when I do a manual 'find/replace', when I run the recorded macro again with new data no dates are replaced!!
The code that is recorded directly from the macro which worked is:
Cells.Select
Selection.Replace What:="31-12-01", Replacement:="N/A", LookAt:=xlWhole _
, SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False
Buy doesn't work when run!
Any help on this would be greatly appreciated!
I have tried replacing the 'What:=" criteria with the formats "DD-MM-YY", "DD-MM-YYYY", "DD-MM-YYYY HH:MM:SS" to no avail.
Thanks,
Richard