View Single Post
 
Old 02-01-2018, 07:06 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I think the following should do it. As you have discovered, what you might think of as a word and what VBA thinks is a word do not necessarily coincide.
Code:
Sub Pluriel()
Dim oRng As Range
Dim lngCase As Long
    Set oRng = Selection.Words(1)
    lngCase = oRng.Case
    oRng.MoveEndWhile Chr(32) & Chr(160), wdBackward
    oRng.Collapse 0
    If lngCase = 1 Then
        oRng.Text = "S"
    Else
        oRng.Text = "s"
    End If
lbl_Exit:
    Set oRng = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote