"Ads by Goooooogle" links provided by Google.com, which has sole control over all advertising content it displays on this site.

Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2008 by Barry MacDonnell. All Rights Reserved.

Page updated Jan 18, 2008
DELETERC - Deletes empty rows and (optionally) columns from a table

Download DELETERC.ZIP (v1.01; 01/18/08; 11,903 bytes)

Compatible with WordPerfect 8,9,10,11,12,X3

WordPerfect 11 users: See important information about using macros in the first release of WP11 (11.0.0.233) at the top of this page.

Downloading, Documentation, Modifications, and Support

This macro deletes all empty rows in the current table (i.e., those without characters), or rows that have empty cells in Column 1. Optionally, it can delete all empty columns following the processing of all table rows.

CAUTION: Always make a backup of your document before playing this macro (or play it on a copy of your document).


Related macro:

See SwapRecs, which can help you properly merge/print 2-column cards from a table containing merge data.

Related tip:

A macro posted by Roy "lemoto" Lewis on WordPerfect Universe removes any row which does not contain a specified string of characters (here, for example, the string is "DAB"). Perhaps the code will be useful to use as a starting point for similar tasks.

BE SURE to also indicate the specific table and cell in your own document in the PosTableCell() command below, which is set (for this example) for Table C, Cell C1.

Application(wp;"WordPerfect";Default!)

vCheckText = "DAB"

PosTableCell("Table C.C1")
While(NOT ?TableLastCell)
SelectWord
RowOut
PosTableCellDown ()
EndWhile
SelectWord

RowOut:
If(StrPos(?SelectedText; vCheckText) =0)
TableDeleteRow
PosTableCellUp
EndIf
SelectMode(Off!)
Return