If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Deleting blank rows / columns in a Word 2002 Table
Does anyone know a quick method or have a macro written to delete blank rows
and/or columns contained in a Word 2002 Table. Please share, I would be most grateful. Thank you in advance for any replies. |
#2
|
|||
|
|||
Deleting blank rows / columns in a Word 2002 Table
Hi Renegade,
like that: Sub Test456() Dim oTbl As Table Dim oRow As Row Dim oClm As Column Dim oCll As Cell Dim LngT As Long Set oTbl = ActiveDocument.Tables(1) For Each oRow In oTbl.Rows If Len(oRow.Range) = (oRow.Cells.Count * 2) + 2 Then oRow.Delete End If Next For Each oClm In oTbl.Columns LngT = 0 For Each oCll In oClm.Cells ' as there is no column range If Len(oCll.Range) 2 Then Exit For ' for speed reasons only End If LngT = LngT + 2 Next If LngT = oClm.Cells.Count * 2 Then oClm.Delete End If Next End Sub -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Vista Small Business, Office XP |
Thread Tools | |
Display Modes | |
|
|