Reformat dates in Word column

E

emilydoggy

I have created a table in Microsoft Word 2000.

One column of this table contains only dates.

The dates in this column are written in various formats such as: 11/2/05 or
2-Nov-05.

I would like to convert all the dates in this column to one single format.

I know how to select the format of new date entries but I would like to
select my "date" column and change all the dates to a similar format.

Thanks,

e_d
 
D

Doug Robbins - Word MVP

Use the following code in a macro that you run when the selection is in the
column containing the dates:

Dim i As Long, j As Long, drange As Range
j = Selection.Information(wdEndOfRangeColumnNumber)
With Selection.Tables(1)
For i = 1 To Selection.Tables(1).Rows.Count
Set drange = .Cell(i, j).Range
drange.End = drange.End - 1
If IsDate(drange) Then
drange = Format(drange, "MMMM dd, yyyy") 'Change the format
string here to get what you want.
End If
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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