I wanted to add an answer when I tried to solve CuberChase, but it did not work with my table:

Notice that in columns 1, 2, and 5. rows are vertically combined. When I implemented Selection.MoveDown with the goal of selecting all the rows in the parent row βA3β, it did not recognize the inner rows in columns 3 and 4. Instead, it selects the parent rows βA4β, βA5β and βA6β (same format, as A3), without selecting inner rows.
Here is what I had to do at the end in order to successfully delete the parent and child rows in my table. First I needed to collect indexes for the first cell of each row to be deleted into an array. I canceled my array to work from the bottom up so as not to change indexes at runtime.
Then I looped around on my inverse array, selecting a range of cells belonging to each parent row, and deleting the rows associated with my selection.
table = ActiveDocument.Tables(1) For Each idx In ReverseArray cells_to_delete = ActiveDocument.Range(Start=table.Range.Cells(idx).Range.Start, End=table.Range.Cells(idx+*count_of_cells*).Range.End) cells_to_delete.Select Selection.Range.Rows.Delete Next idx
I donβt know if anyone has encountered a similar problem, but I decided that I would answer here in case someone did. :)
source share