Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to lock columns/rows in a table in word | Tables | |||
Deleting rows or columns | Tables | |||
Deleting Multiple Blank Rows (which feature two lines) in a Word D | Microsoft Word Help | |||
Deleting Blank Rows in Word | Mailmerge | |||
Deleting blank rows in all tables | Tables |