View Single Post
  #3   Report Post  
Jay Freedman
 
Posts: n/a
Default

On Wed, 20 Jul 2005 15:27:03 -0700, "emilydoggy"
wrote:

I have a table created in Microsoft Word.

One column of the table contains dates of varying formats:
25-Mar-2005
03/25/05
March 25, 2005.

I would like to batch donvert the column of dates so that they all use the
the same format.

Thanks.


You may be able to use a macro like this (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub ReformatDates()
Dim oCell As Cell
Dim oRg As Range

' adjust the table and column indexes as needed...
For Each oCell In ActiveDocument.Tables(1).Columns(2).Cells
Set oRg = oCell.Range
oRg.MoveEnd wdCharacter, -1
With oRg
If IsDate(.Text) Then
' adjust the formatting string as needed...
.Text = Format(CDate(.Text), "MM/dd/YYYY")
End If
End With
Next oCell
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org