![]() |
|
#1
|
||||
|
||||
![]()
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 |
#2
|
|||
|
|||
![]()
Many thanks, that's perfect !
(you even went beneath my expectations while managing the case) Brilliant ! And now, I have to figure out how the code works..... ![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
gazeranco | Word VBA | 8 | 10-29-2016 12:13 AM |
![]() |
pstein | Word | 3 | 08-15-2012 05:08 AM |
![]() |
KIM SOLIS | Excel | 2 | 11-04-2011 06:09 PM |
![]() |
persist | Word | 2 | 04-07-2010 09:52 PM |
![]() |
Styler001 | Word | 4 | 01-25-2010 06:40 PM |