![]() |
|
#2
|
||||
|
||||
|
Probably something like
Code:
Sub Macro1()
Dim oTable As Table
Dim oRng As Range
Dim oRow As Row
Const strText As String = "Text to find"
Set oTable = Selection.Tables(1)
For Each oRow In oTable.Rows
If InStr(1, oRow.Range, strText) > 0 Then
Set oRng = oRow.Range
oRow.ConvertToText Separator:=Chr(9)
oRng.Font.Bold = True
oRng.Font.Size = 14
oRng.ParagraphFormat.Alignment = wdAlignParagraphCenter
oRng.InsertParagraphBefore
End If
Next oRow
lbl_Exit:
Set oTable = Nothing
Set oRng = Nothing
Set oRow = 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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to I create a macro that dynamically creates a table, to enter questions, in the below format?
|
MathiasFC | Word VBA | 11 | 01-14-2019 04:50 PM |
Macro to delete text from cells with specific format
|
Soenke | Word VBA | 4 | 09-01-2016 08:55 AM |
Variable text field code based on occurrences on each page
|
Cosmo | Word | 2 | 12-29-2015 11:54 AM |
| Macro to find text in between two characters and then format selected text? | qcom | Word | 5 | 02-19-2015 11:23 PM |
Replace all occurrences of one merge field with plain text
|
blankenthorst | Mail Merge | 5 | 07-01-2011 05:18 AM |