Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
remove multiple hyperlinks in a table all at once | Tables | |||
Convert multiple lines of text to a single cell in a table | Tables | |||
automatically remove empty rows in a table | Microsoft Word Help | |||
Remove empty paragraphs | Microsoft Word Help | |||
Remove empty paragraphs | Microsoft Word Help |