Shasur
Thu Jul 24 08:15:02 PDT 2008
Here is a hint for that Juan
Sub Search_Specific_TextIn_Tables()
Dim MyTab As Table
Dim sCellText
Dim bTextFound As Boolean
Set MyTab = ActiveDocument.Tables(1)
For I = 1 To 1 ' MyTab.Columns.Count
bTextFound = False
For j = 1 To MyTab.Rows.Count
sCellText = Trim$(MyTab.Cell(j, 1).Range.Text)
' You need to trim the characters and then do the checking
' Here do the checking
If Len(sCellText) <> 0 And InStr(1, sCellText, "MI") = 1 Then
MyTab.Rows(j).Range.Font.Hidden = True
End If
Next j
Next I
End Sub
I have assumed that you are searching for 'MI' in first column. If you want
for all columns please replace
For I = 1 To 1 ' MyTab.Columns.Count
with
For I = 1 To MyTab.Columns.Count
Cheers
--
http://vbadud.blogspot.com
"JuanManuel" wrote:
> Hi,
> If I have something like this in a single cell of a table:
>
> MI: Dimensional inspection. Measure Tangency Angles
>
> HGP: Dimensional inspection. Measure Tangency Angles
>
> CI: Dimensional inspection. Measure Tangency Angles
>
> How do I code a macro to hide only the paragraph starting with "MI" for
> example??
>
> Thank you,
>
> Juan Manuel