![]() |
|
#3
|
|||
|
|||
|
Hi Vivka, thanks so much for your code - unfortunately not what I needed it to do on this occasion but I did take part of your code "([!^13]@)([^t:])" in place of what was in my original code and that has worked how I need it to so really appreciate that.
Code:
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
'Find text before first tab or colon and format bold
.text = "([!^13]@)([^t:])"
While .Execute
If oRng.Characters(1).Start = oRng.Paragraphs(1).Range.Characters(1).Start Then
oRng.Select
oRng.Font.Bold = True
If Not oRng.Characters.Last.Next = vbTab Then
oRng.text = Replace(oRng.text, ":", vbTab)
Else
oRng.Characters.Last.Delete
End If
End If
Wend
End With
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA quote mark to insert after square bracket
|
Shelley Lou | Word VBA | 13 | 06-25-2021 12:41 AM |
Delete blank paragraph below bold, end square bracket
|
Dave T | Word VBA | 2 | 04-28-2019 11:00 PM |
| Conditional format for NCAA bracket | JoemanNville | Excel | 0 | 03-25-2019 01:45 PM |
Remove repeated number after square bracket
|
jeffreybrown | Word VBA | 8 | 12-04-2018 06:01 PM |
| Word 2010 - Remove square-bracket encased string in large document | IntestinalWorm | Word | 1 | 06-20-2017 01:14 AM |