View Single Post
 
Old 01-12-2015, 06:39 PM
scarda scarda is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Jan 2015
Posts: 5
scarda is on a distinguished road
Default Datepicker with suffix

Has anyone had any luck in adding a st (for 1), nd (for 2) rd (for 3) or th (for 4,5,6,7,8,9,0) following the DD in this code?

Quote:
Originally Posted by macropod View Post
Try:
Code:
Private Sub cmdOK_Click()
Application.ScreenUpdating = False
Dim BmkNm As String, NewTxt As String, BmkRng As Range
BmkNm = "DateFiled"
With ActiveDocument
  If .Bookmarks.Exists(BmkNm) Then
    Set BmkRng = .Bookmarks(BmkNm).Range
    BmkRng.Text = Format(dtDateFiled.Value, "MMMM DD, YYYY ")
    .Bookmarks.Add BmkNm, BmkRng
  Else
    MsgBox "Bookmark: " & BmkNm & " not found."
  End If
End With
Set BmkRng = Nothing
Application.ScreenUpdating = True
Unload Me
End Sub
Reply With Quote