| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Jun 8, 2015
incrementing numbers in a table column
with optional prefix and/or suffix characters
QwikFill.wcm is a WordPerfect 9 (and later version) 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 1 -- but easier and with more options. [Screen shot of the macro's menu.]
You can add your own prefix and/or suffix
characters to numbers, such as "#" and/or periods/full stops or other
punctuation marks. Characters can include symbols (with
Insert>Symbol or <Ctrl+W>).
You can also use fixed-width (Bates) numbers (i.e., numbers with leading zeros).
Any column in the table can be numbered, starting in any row. Simply place your cursor in the desired "beginning" cell and play the macro. (See "Known limitations" below.)
How it works
From the current table cell, this macro -
(1) deletes any existing items (cell
contents and formulas) in the current column from the cursor location
to the last cell in that column; then it
(2) adds incrementing numbers (1 .. n) in that column up to, and including, the last cell in that column.
Caution: Obviously, since the macro deletes any existing items in some cells, you should make a backup of your document first.
See the redlined User Modifcation Area in the macro's code. (You can open the macro like any other WordPerfect document, make changes, and then click the Save & Compile button on the macro toolbar.)
Known limitations and caveats
(1) The column cells' Numeric Format must be set to General (the typical default) and not to Text.
(2) The macro language does not offer a way to detect if the cursor is in a header row of a table. (See Table>Format>Row for the header row setting in effect for the current row.) Be sure to start numbering in a non-header row.
Assign this macro to a menu, keystroke combination, or toolbar button. See here.
WordPerfect has a QuickFill feature for tables, which can increment dates as well as numbers (Arabic and Roman).
It cannot, however, automatically add custom prefix and/or suffix text like the QwikFill macro can do.
From WordPerfect X6's Help (F1):
To fill a table with incremental numbers or dates
1. Select the cells that contain the incremental or decremental pattern of values as well as the cells in which you want to continue the pattern.
2. Click Table > QuickFill.
You can use Roman numerals, days of the week, months, or quarters, even if only one cell is used to establish the pattern. To repeat incremental or decremental numbers, however, you must select at least two cells with values to establish a pattern.
You can also fill a table with incrementing numbers or dates by clicking the QuickFill button on the Table formula toolbar. To display the Table formula toolbar, click Table > Formula toolbar.