Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
KWC via OfficeKB.com
 
Posts: n/a
Default Deleting blank rows in all tables

I need a macro that will look at all tables in a document, then delete any
rows in those tables where the entire row is blank.

This is just a start, and does not work. Would someone provide some guidence?
thanks in advance.

Option Explicit
Sub delete_blank_rows()
Dim odoc1 As Document
Dim lngRow As Long
Dim oTable As Table
Dim orow As Row

Selection.HomeKey Unit:=wdStory
If ActiveDocument.Tables.Count = 1 Then
Set odoc1 = ActiveDocument
For Each oTable In odoc1.Tables

For lngRow = oTable.Rows.Count To 1 Step -1
If Selection.Text = "" Then
oTable.Rows(lngRow).Delete
End If
Next lngRow

Next oTable
End If
End Sub
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank spaces between tables in word Sal F Tables 1 March 8th 05 07:29 PM
disalignment of "header row(s)" in tables? mylory2 Tables 0 February 24th 05 09:07 PM
Word tables should permit header rows to repeat only on every oth. vepxistqaosani Tables 4 February 24th 05 05:53 AM
Splitting Rows of tables across page breaks Barb Reinhardt Microsoft Word Help 2 February 22nd 05 02:09 AM
Blank spaces between rows Hélène Tables 9 February 1st 05 04:44 AM


All times are GMT +1. The time now is 11:26 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"