![]() |
|
#2
|
||||
|
||||
|
Hi Adriano,
You could use a macro like: Code:
Sub TableFindConvert()
Application.ScreenUpdating = False
Dim StrTxt As String, StrSty As String, Stl As Style, bSty As Boolean
StrTxt = InputBox("What is the Text to Find", "Text Selection")
StrSty = Trim(InputBox("What is the Style to Find", "Style Selection", "Table-1"))
bSty = False
If StrSty <> "" Then
For Each Stl In ActiveDocument.Styles
If Stl.NameLocal = StrSty Then
bSty = True
Exit For
End If
Next
If bSty = False Then GoTo errExit
End If
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = StrTxt
If StrSty <> "" Then .Style = StrSty
.Replacement.Text = ""
.Format = bSty
.Forward = True
.Wrap = wdFindStop
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
Do While .Find.Found
If .Information(wdWithInTable) = True Then
.Duplicate.Tables(1).ConvertToText Separator:=vbTab
End If
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Exit Sub
errExit:
Beep
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| find, replace, tables |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using Find/Replace or VBA | davidku | Word | 4 | 04-27-2012 04:39 PM |
Bad view when using Find and Find & Replace - Word places found string on top line
|
paulkaye | Word | 4 | 12-06-2011 11:05 PM |
Is there a way to use "find/replace" to find italics words?
|
slayda | Word | 3 | 09-14-2011 02:16 PM |
Find and Replace
|
kjxavier | Excel | 3 | 08-12-2011 10:49 PM |
Help with find and replace or query and replace
|
shabbaranks | Excel | 4 | 03-19-2011 08:38 AM |