View Single Post
 
Old 03-14-2021, 02:18 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The workaround would be to iterate through all the table cells. If you only wanted to pick one table cell per row it would be easiest to settle on the first cell in each row. Note that it might be useful to also know the cell height rule since rows that automatically adjust their heights will all return an undefined height (9999999)
Code:
Sub CheckRows()
  Dim aRow As Row, aCell As Cell, aTable As Table
  
  If Selection.Tables.Count > 0 Then
    Set aTable = Selection.Tables(1)
    If aTable.Uniform Then
      For Each aRow In aTable.Rows
        Debug.Print aRow.Height, aRow.HeightRule
      Next aRow
    Else
      Debug.Print "Table has merged cells"
      For Each aCell In aTable.Range.Cells
        If aCell.ColumnIndex = 1 Then Debug.Print aCell.Height, aCell.HeightRule
      Next aCell
    End If
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote