Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Want all dates in row of a table formatted alike.
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. |
#2
|
|||
|
|||
Sorry, Em. Word doesn't support "date formats". Try copying them into Excel,
then formatting, then bringing back to Word. But I'm not sure that'll work either. ******************* ~Anne Troy www.OfficeArticles.com "emilydoggy" wrote in message ... 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. |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
Anne Troy was telling us:
Anne Troy nous racontait que : Sorry, Em. Word doesn't support "date formats". Try copying them into Sure it does, ever heard of Insert Date and Time... ? Have you seen how many formats are available there? They are even language specific. Excel, then formatting, then bringing back to Word. But I'm not sure that'll work either. I would suggest that you try out simple stuff like this instead of recommending it untested. -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#5
|
|||
|
|||
Then how does she convert all these dates that exist to the same format?
******************* ~Anne Troy www.OfficeArticles.com "Jean-Guy Marcil" wrote in message ... Anne Troy was telling us: Anne Troy nous racontait que : Sorry, Em. Word doesn't support "date formats". Try copying them into Sure it does, ever heard of Insert Date and Time... ? Have you seen how many formats are available there? They are even language specific. Excel, then formatting, then bringing back to Word. But I'm not sure that'll work either. I would suggest that you try out simple stuff like this instead of recommending it untested. -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#6
|
|||
|
|||
Dim i As Long, j As Long, drange As Range, dtable As Table
Set dtable = Selection.Tables(1) j = Selection.Information(wdEndOfRangeColumnNumber) For i = 2 To dtable.Rows.Count Set drange = dtable.Cell(i, j).Range drange.End = drange.End - 1 drange.Text = Format(drange.Text, "dddd, MMMM d, yyyy") Next i -- 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 "Anne Troy" wrote in message ... Then how does she convert all these dates that exist to the same format? ******************* ~Anne Troy www.OfficeArticles.com "Jean-Guy Marcil" wrote in message ... Anne Troy was telling us: Anne Troy nous racontait que : Sorry, Em. Word doesn't support "date formats". Try copying them into Sure it does, ever heard of Insert Date and Time... ? Have you seen how many formats are available there? They are even language specific. Excel, then formatting, then bringing back to Word. But I'm not sure that'll work either. I would suggest that you try out simple stuff like this instead of recommending it untested. -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#7
|
|||
|
|||
Doug Robbins was telling us:
Doug Robbins nous racontait que : Dim i As Long, j As Long, drange As Range, dtable As Table Set dtable = Selection.Tables(1) j = Selection.Information(wdEndOfRangeColumnNumber) For i = 2 To dtable.Rows.Count Set drange = dtable.Cell(i, j).Range drange.End = drange.End - 1 drange.Text = Format(drange.Text, "dddd, MMMM d, yyyy") Next i Thanks Doug, I hadn't answered because Jay already had before I even posted my message. I guess it will reinforce the message if two versions are available! -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#8
|
|||
|
|||
Yes, I didn't see Jay's post until after I had posted my method.
-- 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 "Jean-Guy Marcil" wrote in message ... Doug Robbins was telling us: Doug Robbins nous racontait que : Dim i As Long, j As Long, drange As Range, dtable As Table Set dtable = Selection.Tables(1) j = Selection.Information(wdEndOfRangeColumnNumber) For i = 2 To dtable.Rows.Count Set drange = dtable.Cell(i, j).Range drange.End = drange.End - 1 drange.Text = Format(drange.Text, "dddd, MMMM d, yyyy") Next i Thanks Doug, I hadn't answered because Jay already had before I even posted my message. I guess it will reinforce the message if two versions are available! -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#9
|
|||
|
|||
Hi, Emily. I tested the copy/paste to Excel, format as dates, then
copy/paste back to Word, and it worked like a charm. ******************* ~Anne Troy www.OfficeArticles.com "emilydoggy" wrote in message ... 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. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Table headers/footers and layout | Page Layout | |||
How to Avoid Word 2003 Table Style Problems | Tables | |||
Table AutoFormats vs. Table Styles confusion | Tables | |||
Import csv data into a specifically formatted Word table | Tables | |||
Excel dates formatted d/m/yy convert to m/d/yy in mail merge | Mailmerge |