Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Francis4344 Francis4344 is offline
external usenet poster
 
Posts: 2
Default How to remove multiple empty lines in a table

Sure, you can select and remove a line but this table was generated from an
Wp document with an empty line at every other line...

Any way of telling Word, either through a macro or otherwise, to remove all
empty lines?
  #2   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default How to remove multiple empty lines in a table

Easy enough to write a macro to do it, if you know how to write macros.
Depending on what your rows contain, you could also simply sort the table:
then the empty rows come together and you can delete them in one action.




"Francis4344" wrote in message
...
Sure, you can select and remove a line but this table was generated from
an
Wp document with an empty line at every other line...

Any way of telling Word, either through a macro or otherwise, to remove
all
empty lines?



  #3   Report Post  
Posted to microsoft.public.word.tables
Access101 Access101 is offline
external usenet poster
 
Posts: 9
Default How to remove multiple empty lines in a table

And if you want to maintain the same order as the original, just add a
column, auto number it, and then resort after the deletions

"Jezebel" wrote:

Easy enough to write a macro to do it, if you know how to write macros.
Depending on what your rows contain, you could also simply sort the table:
then the empty rows come together and you can delete them in one action.




"Francis4344" wrote in message
...
Sure, you can select and remove a line but this table was generated from
an
Wp document with an empty line at every other line...

Any way of telling Word, either through a macro or otherwise, to remove
all
empty lines?




  #4   Report Post  
Posted to microsoft.public.word.tables
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How to remove multiple empty lines in a table

Auto numbering will be updated when you sort, so it won't help much.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Access101" wrote in message
...
And if you want to maintain the same order as the original, just add a
column, auto number it, and then resort after the deletions

"Jezebel" wrote:

Easy enough to write a macro to do it, if you know how to write macros.
Depending on what your rows contain, you could also simply sort the

table:
then the empty rows come together and you can delete them in one action.




"Francis4344" wrote in message
...
Sure, you can select and remove a line but this table was generated

from
an
Wp document with an empty line at every other line...

Any way of telling Word, either through a macro or otherwise, to

remove
all
empty lines?





  #5   Report Post  
Posted to microsoft.public.word.tables
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default How to remove multiple empty lines in a table

And if you want to maintain the same order as the original, just add a
column, auto number it, and then resort after the deletions



"Suzanne S. Barnhill" wrote:
Auto numbering will be updated when you sort, so it won't help much.


SEQ fields won't unless you update fields, and it's pretty easy to put one
into an otherwise empty column (... copy the field, select column, paste).

Klaus




  #6   Report Post  
Posted to microsoft.public.word.tables
Kon Kon is offline
external usenet poster
 
Posts: 1
Default How to remove multiple empty lines in a table

I think that you are talking about excel, not word. I was wondering how to
do it in word by vba for some time now and would appreciate help
  #7   Report Post  
Posted to microsoft.public.word.tables
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default How to remove multiple empty lines in a table

Hi Kon,

The following code will delete all blank rows (except for those with vertically merged cells) in all tables in the active document:

Sub DelBlankRows()
Dim Pwd As String
Dim oRow As Integer
Dim oTable As Table
Dim pState As Boolean
With ActiveDocument
pState = False
If .ProtectionType wdNoProtection Then
Pwd = InputBox("PleasePassword", "Password")
pState = True
.Unprotect Pwd
End If
If .Tables.Count 0 Then
For Each oTable In .Tables
For oRow = oTable.Rows.Count To 1 Step -1
If Len(Replace(oTable.Rows(oRow).Range.Text, Chr(13) & Chr(7), vbNullString)) = 0 Then
On Error Resume Next 'skip vertically merged cells
oTable.Rows(oRow).Delete
End If
Next oRow
Next oTable
End If
If pState = True Then .Protect wdAllowOnlyFormFields, Noreset:=True, Password:=Pwd
pState = False
Pwd = ""
End With
End Sub

If the document is protected for forms, you'll need to replace "Password" with the real password (if any)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Kon" wrote in message . ..
I think that you are talking about excel, not word. I was wondering how to
do it in word by vba for some time now and would appreciate help

Reply
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
remove multiple hyperlinks in a table all at once ahimsa Tables 1 June 8th 05 11:15 PM
Convert multiple lines of text to a single cell in a table Dan_unique Tables 3 April 17th 05 05:15 PM
automatically remove empty rows in a table Ginger Microsoft Word Help 5 February 6th 05 12:50 PM
Remove empty paragraphs imsnowman Microsoft Word Help 1 January 18th 05 01:57 PM
Remove empty paragraphs Fred Microsoft Word Help 2 January 17th 05 10:34 PM


All times are GMT +1. The time now is 06:02 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"