VBA Macro to Delete Empty Lines in Word Tables -
i been struggling word macro deletes empty lines "$" exists. code below works selected table, how can have code loop through entire document , delete empty lines pages.
option explicit sub test() dim long selection.tables(1) = .rows.count 1 step -1 if len(.cell(i, 2).range.text) = 3 , left(.cell(i, 2).range.text, 1) = "$" .rows(i).delete end if next end end sub
this not tested on same data-set op has since not provided.
option explicit sub test() dim tbl table dim mdoc document dim orow row set mdoc = activedocument each tbl in mdoc.tables each orow in tbl.rows if len(orow.cells(2).range.text) = 3 , _ left(orow.cells(2).range.text, 1) = "$" orow.delete end if next orow next tbl end sub
Comments
Post a Comment