Consulting

Results 1 to 5 of 5

Thread: Copy the heading numbering in the table

  1. #1

    Copy the heading numbering in the table

    Dear All,

    I am looking for a solution to copy the heading number from 1st column to the cell next to it. And after the heading number is updated on the 1st column, the prefix/number on the second column should also be updated.

    Those heading number are made by a list. Here's is the sample. I don't know how it works in a MS word table.

    Before:

    Sample (Before.docx
    Before.jpg

    After:

    Sample (After).docx
    After.jpg
    Last edited by kamkwok6; 02-07-2023 at 02:47 AM.

  2. #2
    VBAX Contributor
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    119
    Location

    You can use a cross-reference to copy your number. This is a dynamic field.

    I'm not sure this is a vba question, but I don't have a vba solution. Someone else may.
    What you want for those subsidiary numbers is likely a cross-reference field.

    Note that headings in a table will not show upr as bookmarks in a pdf conversion, nor in the Navigation Pane.
    Headings that do not show up in the Navigation Pane or in a Table of Contents (or in Cross-References / Hyperlinks)

    00 deleteme 1.jpg

    Here is a temporary link to a file that uses this technique.
    https://www.dropbox.com/s/df1qal1sti...teme.docx?dl=0

    This has nothing to do with the position in the table. The cross-reference is to the heading.
    Insert Cross-References
    Last edited by Chas Kenyon; 02-07-2023 at 10:04 AM. Reason: add image

  3. #3
    VBAX Contributor
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    119
    Location
    You said that the numbering comes from a list. There is only one method known to produce stable automatic numbering in Word. If you use automatic paragraph numbering or bullets read Shauna Kelly's directions on numbering and bullets. Start with How to create numbered headings or outline numbering in Word 2007 and Word 2010. For large documents you must follow these directions or you will lose your hair!
    (Mac version: https://www.brandwares.com/bestpract...word-for-os-x/)

    This may seem a bit convoluted at first, but it really is not. Just follow the steps. Shauna Kelly's instructions use the built-in heading styles, but you can use any existing paragraph styles including your custom styles. There are, however advantages to using the built-in heading styles when you create a Table of Contents. Here are some more advantages: Why Use Word's Built-In Heading Styles? by Shauna Kelly Note, you can modify these built-in styles to look exactly the way you want.

    If you want, I can provide links to videos demonstrating setting up numbering linked to styles.

    The basic idea is that the numbering is set using the Define MultiLevel List dialog with each numbering level being attached to an existing paragraph style. Once you have this set up, you should not use the buttons for numbering in the Ribbon but rather apply the appropriate style for that level.

    You can save a document with this as a template for future documents if you want so you will not need to do this every time.

  4. #4
    Thanks a lot !!! It does really help in some way. However, could it be a more advanced solution with VBA? Let’s say, the VBA will automatic get the “paragraph number” of a “numbered item” from the left column of my selected cell and then insert back in my selected cell

  5. #5
    VBAX Contributor
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    119
    Location
    So, write the vba to create a cross-reference field to the number of the heading in Cells(1) of the row.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •