![]() |
#12
|
|||
|
|||
![]()
No worries Greg. Thanks for the follow-up.
@Paul, I suppose I'm still doing something wrong here. I placed that bit of text after the line: With Selection.Range, but it only fixes the last entry in the selection. I stepped thru the code and can see it looping, but it doesn't loop one paragraph at a time. Code:
Sub MakeTitle() Application.ScreenUpdating = False Dim StrTmp As String With Selection.Range Do While InStr(.Text, Chr(151)) > 0 .Start = .Start + InStr(.Text, Chr(151)) Loop StrTmp = Trim(.Text) While Right(StrTmp, 1) = "." StrTmp = Left(StrTmp, Len(StrTmp) - 1) Wend While InStr(StrTmp, " ") > 0 StrTmp = Replace(StrTmp, " ", " ") Wend StrTmp = TitleCase(StrTmp, bCaps:=False, bExcl:=True) .Text = StrTmp End With Application.ScreenUpdating = True End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
neilfxb | Word | 21 | 02-22-2023 12:47 PM |
Macro that formats (true title) case by Heading style | Marrick13 | Word VBA | 11 | 09-20-2015 06:29 PM |
![]() |
Madanjeet | Word | 6 | 05-18-2015 10:11 AM |
Stop review query when small case at beginning of line | dsrose | Word | 2 | 01-22-2014 12:19 AM |
![]() |
Marrick13 | Word VBA | 14 | 12-11-2013 09:12 PM |