B
blobb
Hi. I have a file that has a date of birth in the format of MM-DD-YYYY and I
would like to reformat it to YYYY-MM-DD.
An example of what the data looks like: <DoB>01-01-1990</DoB>
I was attempting to isolate the date and change the formating using this code:
With Selection.Find
.Text = "<DoB>"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
.StartIsActive = False
.Extend Character:="<"
End With
Dim rdate As Range
Set rdate = Selection.Range
rdate = Format(rdate, "YYYY-MM-DD")
it doesn't appear to work. Could someone help? thanks!
would like to reformat it to YYYY-MM-DD.
An example of what the data looks like: <DoB>01-01-1990</DoB>
I was attempting to isolate the date and change the formating using this code:
With Selection.Find
.Text = "<DoB>"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
.StartIsActive = False
.Extend Character:="<"
End With
Dim rdate As Range
Set rdate = Selection.Range
rdate = Format(rdate, "YYYY-MM-DD")
it doesn't appear to work. Could someone help? thanks!