| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Jan 28, 2019
| Macros that can
incrementing numbers or dates in a table column
with optional prefix and/or suffix characters
Related pages -
• Using WordPerfect tables - Dozens of tips and links to related resources
| The QWIKFILL.ZIP
file contains 2 macros:
QwikFill.wcm: 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 (i.e., optional user-specified prefix and/or suffix and/or optional fixed-width Bates numbering).
QwikFill Dates.wcm: Automatically fills a series of table cells — even dozens or hundreds of them — in the current table column with your chosen dates (in plain text), each date incremented by a chosen interval (e.g., every "n" days/weeks/months/years)
QwikFill.wcm (v1.3) 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 padded 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
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 or other format style.
version 1.3 the macro will do this automatically. But if you wish to do
it manually in any table:
Tip: To set a column to General
format the easy way:
(a) Move the cursor
in a cell to near the top border of the cell until it turns into an
upward-pointing arrow --
(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.
(v1.0) is a macro that automatically fills a series of table
cells — even dozens or hundreds of
them — in the current table column with your chosen dates (in
plain text), each date incremented by a chosen interval (e.g., every "n" days/weeks/months/years).
Example: Type numerical dates into a table column (and add weekdays to each date) for every other day starting on Jan. 25, 2019:
automatically calculated based on a starting date (the default is the
current date but you can specify another date), so months with less
than 31 days as well as leap years are taken into account when
incrementing the dates. [All dates are calendar dates; hence the macro includes weekends and holidays in its calculations.]
Optionally, you can
include extra text characters or symbols (e.g., a checkbox) from a menu
to include before and/or after each date.
Unlike using (e.g.) a
typical monthly-calendar-on-a-page (there's a macro for that!) a table allows formatting larger
amounts of date-specific material using adjacent table cells — which
items are easy to manually select and copy later into multiple cells.
Further, the typed dates can then act as paragraph or section headings for each adjacent block of
When played with
the cursor located inside a table cell, a menu will appear to let you specify the:
• start date for the desired range of cells [Year, Month, Day (the default is the current date)];
• number of dates to insert in the current column (max=9999);
• number of rows between each of the dates (can be used for extra material or as spacing);
• number of days, weeks, months or years between each date (i.e., the interval period);
• format (i.e., dates in all numbers, or dates composed of both names and numbers); and
• any text or symbols (e.g., a checkbox inserted with Ctrl+W) to add before and/or after each inserted date.
Since all dates are
into the cells they can be formatted in a large variety of ways — e.g.,
numbers only, mixed text and numbers, day before month and vice versa,
• open a new blank document,
• use Table, Create to create a multi-row table, and
• play the macro with the cursor in any cell.
• This macro does NOT use WordPerfect's
built-in QuickFill feature
(on the program's Table menu choice). Instead, it calculates each date,
formats it, and types it into the appropriate table cell as plain text.
Hence the dates are not designed for further calculation.
• You can
always immediately undo date
insertions with Edit, Undo (or with Ctrl+z).
• To type the last day
of every "n" months, set the Start date's Day field to 31 and choose
month(s) for the Interval. As with other intervals you can choose,
months with less that 31 days (February, April, June, September, and
November) and leap year dates will be automatically adjusted.
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.
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.