Hi Folks,
The below code will adjust the height of rows in my table based on text length in the first column, however, my last row contains merged cells and I get run time error 5992 Cannot access individual columns in this collection because the table has mixed cell widths.
Would anyone be able to add or amend where the last row is excluded.
Thanks
Fra
Sub columntocheck() Dim tbl As Word.Table Dim ColToCheck As Long Dim cel As Word.Cell Set tbl = ActiveDocument.Tables(1) ' Table 1 change to suit ColToCheck = 1 ' Column 1 tbl.Columns(ColToCheck).Select For Each cel In Selection.Cells If Len(cel.Range.Text) > 21 Then cel.Range.Rows.Height = 30 End If Next End Sub