![]() |
|
#4
|
||||
|
||||
|
Based on that information
Code:
Sub RemoveZeroValues()
Dim oTable As Table
Dim oCell As Range
Dim lngCount As Long
If Not Selection.Information(wdWithInTable) Then
MsgBox "Put the cursor in the table and run the macro again"
GoTo lbl_Exit
End If
Set oTable = Selection.Tables(1)
For lngCount = oTable.Rows.Count To 2 Step -1
Set oCell = oTable.Rows(lngCount).Cells(2).Range
oCell.End = oCell.End - 1
If val(oCell.Text) = 0 Then oTable.Rows(lngCount).Delete
Next lngCount
lbl_Exit:
Set oTable = Nothing
Set oCell = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
| Tags |
| table headers, vba macro |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Repeat header of table within another table
|
Dart82 | Word Tables | 3 | 04-11-2016 04:15 AM |
How to repeat table header of table within table
|
CTNAM | Word Tables | 1 | 04-11-2016 04:14 AM |
| Delete table lines/Condense table | frustrated teacher | Word VBA | 3 | 12-14-2015 02:03 AM |
| Macro Needed to delete Unwanted paragraphs within a table. | frustrated teacher | Word VBA | 0 | 06-05-2015 12:47 PM |
Unable to delete row below table header
|
clarence | Word | 2 | 11-23-2014 02:13 AM |