JamesT
09-27-2016, 10:35 PM
Hi,
I'm trying to format cell heights in a table in the third column (where the cells have been split) - every even cell needs to be .5cm and odd cell (excluding the first) needs to be 3.5cm.
The code i'm running with is below and i'm getting a 'requested member of the collection does not exist' error, I'm a newbie at coding....
----Sub formatnewrows()
Dim r As Integer
Dim c As Integer
c = ActiveDocument.Tables(2).Columns(3).Cells.Count
MsgBox c
For r = 2 To c
If r Mod 2 = 0 Then
Selection.Tables(2).Cell(r, 3).Height = CentimetersToPoints(0.5)
Else
Selection.Tables(2).Cell(r, 3).Height = CentimetersToPoints(3.14)
End If
Next r
End Sub
I'm trying to format cell heights in a table in the third column (where the cells have been split) - every even cell needs to be .5cm and odd cell (excluding the first) needs to be 3.5cm.
The code i'm running with is below and i'm getting a 'requested member of the collection does not exist' error, I'm a newbie at coding....
----Sub formatnewrows()
Dim r As Integer
Dim c As Integer
c = ActiveDocument.Tables(2).Columns(3).Cells.Count
MsgBox c
For r = 2 To c
If r Mod 2 = 0 Then
Selection.Tables(2).Cell(r, 3).Height = CentimetersToPoints(0.5)
Else
Selection.Tables(2).Cell(r, 3).Height = CentimetersToPoints(3.14)
End If
Next r
End Sub