Convert text to date

  • Thread starter Thread starter hl
  • Start date Start date
H

hl

I would like to convert text in the form of M/d/yy to a date in the
form of MMMM d, YYYY. Any ideas?
 
You could select the date and run this macro:

Sub FormatTheDate()
Dim oSel As String
Dim MyLongDate As String
oSel = Selection.Range.Text
MyLongDate = Format(CDate(oSel), "MMMM d, yyyy")
Selection.Range.Text = MyLongDate
End Sub
 
Thanks, that works great. I was hoping that you might know of a way to
do it in a field formula that automatically converts the entry. I have
bookmarks that are entered in the M/d/yy format that need to be
converted throughout a document.
 

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

Similar Threads


Back
Top