Hi Cheryl,
On re-reading your post, I think I may not have been fully understanding what you have. There are two possible situations I can see; the first is where you have a paragraph mark in the cell (as you describe) and the second is where you have some styling but no paragraph mark.
The only way I can see for the first case to arise is if an empty paragraph is copied from one of the original cells. The second case is more interesting and the problem is not in doing it so much as knowing what is wanted.
When you insert a table in Word, all the cells inherit the style at the insertion point, When you add a new row to a table above an existing row each cell inherits the style from the first paragraph in the cell immediately below. When you add a new row to a table below an existing row (this is not normally an option in Word 97 but happens when you tab out of the last cell in the last row of a table) each cell inherits the style from the last paragraph in the cell immediately above. Unless you explicitly change them, the cells will retain whatever style they have inherited.
For the benefit of readers who do not have your test data, you have a table with a few empty columns with a style of “Table Data” and a single multi-paragraph column in the middle with a style of “Table Bullet”. These are your own styles, they don’t come with Word.
When a new row is added to your table each cell inherits a style according to the rules above and this sometimes gives you a cell with a bullet in it. Manually you can remove the bullet with a few keystrokes but this does not change the style - it is still “Table Bullet” but now the paragraph does not have bullets so it gives the appearance of being empty and unstyled.
I have amended my code so that, hopefully, it removes all the obvious formatting (bullets and numbers) from empty cells it creates, and also removes any empty row at the end it may have created. I’m not sure this is the complete solution to your problem and it may appear to work at the moment only for some unforeseen condition to arise later. I have e-mailed you a complete version and, for others, the changes I have made are:
1. Code which inserts rows which used to be:
Code:
If tjCell.RowIndex = tjTable.Rows.Count Then
Selection.MoveRight Unit:=wdCell, Count:=1
If intParas > 2 Then Selection.InsertRows intParas - 2
Else
Selection.MoveRight Unit:=wdCell, Count:=1
Selection.InsertRows intParas - 1
End If
Now reads
Code:
' Moving forward a cell creates a row if on last row
' If not on last row, do it explicitly after tabbing forward
Code:
If intRow2 < tjTable.Rows.Count Then
Selection.MoveRight Unit:=wdCell, Count:=1
Selection.InsertRows
Else
Selection.MoveRight Unit:=wdCell, Count:=1
End If
Code:
' Clear bullets and numbers from all inserted cells
Code:
For Each tjCell2 In tjTable.Rows(intRow2 + 1).Cells
tjCell2.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph
Next
Code:
' Insert extra rows (if needed) above previous inserted one
Code:
If intParas > 2 Then Selection.InsertRows intParas – 2
2. Extra code added right at the end of the For intRow2 .. Next Loop
Code:
' (Dimmed as Boolean at start)
Code:
For Each tjCell2 In tjTable.Rows(intRow2 + intParas - 1).Cells
If tjCell2.Range.Text <> vbCr & Chr(7) Then
EmptyRow = False
Exit For
End If
Next
If EmptyRow Then tjTable.Rows(intRow2 + intParas - 1).Delete
Enjoy,
Tony