Fixing numbers in a table

D

DNH

I have a table with one column reserved for numbers. I would like to cut and
paste groups of rows from this table into another document, and use the
number column as a reference to the row location in the original table.
However, when I cut and past two segments from the same table (e.g. lines
32-35 and lines 55-69), the numbering is reset to one list (the lines are now
numbered 32-40). Is there any way to fix the numbering to a set value per
row so that I can cut and paste them in the original format? Thanks.
 
S

Stefan Blom

You can convert numbering to text. Select the relevant column. Then press
Alt+F11 to display the Visual Basic Editor. Press Ctrl+G to display the
Immediate window. Type

Selection.Range.ListFormat.ConvertNumbersToText

and press Enter.

Now you can cut and paste rows from into the other document, and the numbers
won't change.
 
D

danhattan

This is really cool, and I can think of an immediate use for this, but one
question. Is this a one-time command, in other words, does it work only on
the currently selected text? Another way to ask I suppose would be does it
have to be turned off?
 
S

Stefan Blom

It applies to the selection, only. You can make it operate on all lists in a
document by using ActiveDocument.ConvertNumbersToText. And you can use the
NumberType argument to specify the type of list (all lists, LISTNUM fields,
or paragraph numbering).

Note also that if you applied numbering with styles, you can bring it back
with the ResetPara command (Ctrl+Q); remove numbering from the style
definition(s) to get rid of it completely.
 
D

danhattan

Hi Stefan.

Got a chance to use this technique this morning and it raises another
question. The table cell I selected was numbered at the top level, but had
bullets in the sublevels. Using this command wreaked havoc on the bullets
(changing the bullet shape, eliminating or skewing the indenting). Oddly, the
first cell converted and pasted was perfect, but subsequent cells converted
and pasted below it all had the bulleting warped.

Is there a particular reason the command distinguished between numbers and
bullets the first time, but not subsequent times? In case it's important, I
didn't type the command line on the subsequent tries, just put the cursor at
the end of the already typed line and pressed enter.

Please let me know what you think when you have the chance. Thanks.

Dan
 
S

Stefan Blom

ConvertToText replaces autonumbering with the corresponding character, which
means that each character in a symbol font (bullets) will be replaced with
the corresponding character in an "ordinary" font. In other words,
ConvertToText works best with "true" numbers. Alternatively, before
converting, modify the bullets to (say) asterisks or hyphens, that is, to any
characters that exist in a non-symbol font.

For the indents, you may need manual adjustment after the conversion (as
you've seen).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top