| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Feb 15, 2017
|Table searcher (for WordPerfect tables)|
Other pages on this site related to WordPerfect tables:
• Using WordPerfect tables (many tips and links)
• Table gridlines, table borders, table guidelines - what they do and how they work. Why you might not see borders around cells on your screen, or see "reverse text" (white text on a dark cell background) in a table, etc.
• Rotate table cell contents either 90, 180, or 270 degrees (or "skew" the contents at an angle).
• Brackets - A macro that creates an "outdented" table -- i.e., a table that extends slightly outside page margins -- with a large, full-height left and/or right border that simulates a large square bracket ("[" and/or "]"); the result can also be "indented"
• Calendars - Macros to create monthly or annual calendars using tables
• ColSrchr - Column searcher (2 macros) that search just the current column for the specified text (1 macro can then color the rows where the items are found)
• DeleteRC - Deletes empty rows and/or columns in the current table
• QwikFill - A macro that adds incrementing numbers (1..n) in the current table column from the current cell to the bottom of the column, in a manner similar to WordPerfect's QuickFill feature -- but easier and with more options
• RowLines - Adds underlines and/or fills (shading) to every Nth row in a table for added readability or improved appearance
• A macro posted by Roy "lemoto" Lewis on WordPerfect Universe here removes any row which does not contain a specified string of characters
|Table search - color
rows.wcm (v1.01, for WordPerfect 9 and later
Purpose and operation
This macro finds user-specified text anywhere in the current WordPerfect table. The text to find can be up to 79 characters (including spaces). It does this by searching each cell individually (which is very fast) from the first cell to the last cell.
It colors any table ROW that contains the item -- text, symbols, and/or numbers -- that you specify (via a pop-up dialog) using a previously specified "fill" color. The default fill is light green but this can be changed (see tips below).
[New in version 1.01: Progress is shown on screen as the macro moves through the table, then it displays the results in a small dialog.]
After playing the macro you can undo changes made to the document during the session with Edit, Undo (or Crtl+Z). Alternatively, simply save the document with a different name (File, Save As).
Note that it will search only inside the current table and it will not remove existing color fills in other rows where the current search item is not present. It will, however, add the color fill to the entire row where the item is found, even if some cells in that row were previously colored. (Undoing the change to the row fills with Ctrl+Z should restore previous fills.)
☼ Alternative to undoing the change (Ctrl+Z):
You can remove the colored fills by -
[A] selecting the table with the "Select - Select all cells..." button on the Table property bar (or with Edit, Select, Select Table on the program menu);
[B] selecting just the current row with the Select Table Row button on the property bar.
Then right-click on the selection and choose Border/Fill and set the Cell fill for that selection to "X" (<None>).
☼ See the redlined User Modification Area at the top of the macro's code to set your preferences. (Macros can be opened like any other WordPerfect document. Make your changes and click the Save & Compile button on the macro toolbar.)
☼ See ColSrchr for a similar macro (Column search - color rows.wcm) -- but that searches just in the current column rather than in the entire table.
☼ You can make several copies of this macro, each with a slightly different name and different default values for color, etc. See the User Modification Area.
☼ You can redact (i.e., black out) rows for printing purposes (the underlying data is unaffected) by setting all three RGB color values to 0 (zero) and the shade to 100 percent, in the User Modification Area.