A
Alastair MacFarlane
Dear All
I am trying to recurse through every cell in the the first
column of a table and obtain the cell contents. I have
used the following code (which works) but could be better:
Dim oRow As Row
Dim oCell As Cell
Dim sCellText As String
For Each oRow In ActiveDocument.Tables(1).Rows
sCellText = oRow.Cells(1).Range
sCellText = Left$(sCellText, Len(sCellText) - 2)
Debug.Print Trim(sCellText)
Next oRow
but I do not want all values returned but only those where
the cell or the font is NOT shaded or conversely where the
cell has no shading at all in the font or cell itself. It
is this part I am stuck with.
Can someone please help me?
Alastair MacFarlane
(very bad at Word VBA)
I am trying to recurse through every cell in the the first
column of a table and obtain the cell contents. I have
used the following code (which works) but could be better:
Dim oRow As Row
Dim oCell As Cell
Dim sCellText As String
For Each oRow In ActiveDocument.Tables(1).Rows
sCellText = oRow.Cells(1).Range
sCellText = Left$(sCellText, Len(sCellText) - 2)
Debug.Print Trim(sCellText)
Next oRow
but I do not want all values returned but only those where
the cell or the font is NOT shaded or conversely where the
cell has no shading at all in the font or cell itself. It
is this part I am stuck with.
Can someone please help me?
Alastair MacFarlane
(very bad at Word VBA)