Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    I have a Word document that I use as a template when I need to present some summarized data. Most of the document is plain text, but at about 15 different places throughout the document, there are two lines, each of which has three numbers equally spaced across the page. I need the numbers on these two lines to be lined up vertically. I've been doing it by tabbing as I go across the line, and entering the numbers. But since I am now using this as a template, I am trying to come up with a way to simply the alignment, and have the alignment stay the same regardless of the number of characters that is entered for each number.

    The first thing that comes to mind is to set up multiple sections that contain just the two lines with the numbers, and format three columns in those sections. But since this situation happens 15 times through the document, this seems rather tedious.

    I am always surprised by what I don't know in Word, so my question is, is there any other way to do this?

    Thanks

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    What I'd do is create a new style that you can apply to those paragraphs where you'll always want the three numbers to line up in the same place.
    In the definition of the style, set up three center tabs, one for each location where you want a number to align.

    Then anywhere in the document where you need to align the numbers, just apply this style, and tab once to move to the location where you can type the next number.

    The numbers will always line up in the same place that way, with no need to do extra formatting each time.

    Gary

  3. #3
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    If the numbers need to be decimal-point aligned, you might use a decimal tab instead of a center tab.

    Although I like Gary's suggestion better for this simple case, another choice is a two-row, three-column, no-border table with a decimal tab in each column or with each column set to center the content.

    Pam
    Pam Caswell

  4. #4
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Chichester, UK
    Posts
    401
    Thanks
    1
    Thanked 10 Times in 9 Posts
    I believe that Pam's method using a table with three fixed columns, centred and with decimal tabs will be the most reliable.

    Terry

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    Yep, I agree with Pam and Terry - first thought that came to mind was to create a style, but for lining up numbers, a table is really the better way to go.

    Gary

  6. #6
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    And the empty table can be saved as autotext and recalled quickly.
    Pam Caswell

  7. #7
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    Hi,
    Using the table worked out very well!

    Thank you to all.

    Vince

  8. #8
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    I do have another question.

    The numbers that go in the tables on this document are taken from an Excel spreadsheet. Usually I display both the spreadsheet and the Word doc on my screen, and then drag or copy the numbers over from Excel to the Word doc.

    The Excel spreadsheet is a template that I use repeatedly (for different clients, so it has different data every time). Same with the Word doc which is a summary of the spreadsheet.

    Is there some way I can set it up so that the numbers will transfer automatically? There are 15 sets of numbers on the spreadsheet that need to go into each of the 15 tables in the Word doc.

    Thanks

  9. #9
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    By the way, I'm not sure if it makes any difference, but when I say it is a template, that is not the usual meaning where the file is stored as a Template file, but just regular Excel and Word docs that I re-use each time, adding the data for each new client.

    Thanks

  10. #10
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by Vincenzo View Post
    The numbers that go in the tables on this document are taken from an Excel spreadsheet. ... Is there some way I can set it up so that the numbers will transfer automatically? There are 15 sets of numbers on the spreadsheet that need to go into each of the 15 tables in the Word doc.
    The short answer is "Yes." The long answer is, "with a couple of hours of coding and testing, Yes."

    The macro language in Word, Visual Basic for Applications, can read Excel workbooks either by automating Excel (starting up the application and loading the workbook so Word is completely in control), or by reading the .xls file as a database. I am not an expert on getting data out of Excel, but I'm sure there are code examples here in the Lounge, probably on the Word, Excel, and VBA boards.

    Once you have the data source open and accessible, and know how to read out the values, it's pretty easy to insert data into table cells. If there are other tables in the document, that might complicate the process because the code would need to recognize which ones are the correct ones.

  11. #11
    Star Lounger
    Join Date
    Dec 2009
    Location
    Lansing, MI
    Posts
    65
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Here's a simpler solution that may work for you if you are familiar with creating a merge form and know just enough Excel to be dangerous (which would be where I place myself). This solution depends on the fact that you would not be adding data to your data file that would shift the cells around because it is based on cell referencing.

    First, back up your form and data, then open your spreadsheet. Create a new blank sheet if you don't already have one available. Create some titles in the first row that will help you determine which data is which when you do the merge later in Word. In the cell directly under each of your titles, create a formula that references the desired cell in the other sheet. For example, "=(Sheet1!B2)" would reference the cell B2 on Sheet 1. You should only have two rows on this spreadsheet - this is going to be your merge data. Therefore, Row 1 is the titles, Row 2 is the referenced cells.

    Next, turn your document into a merge form. You can use the wizard if you have never created a merge form before. When you select your data, choose the data file you created, but make sure to choose the sheet you created your merge data on. Drop in your fields where they belong, save the new Merge Form and run the merge.

  12. #12
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    That sounds like a good idea, Richelle. I am going to give it a try, once I iron out a few details on my formatting, and then figure out how to do the merge form. I'll report back my results.

    Thanks

  13. #13
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    Richelle, I am trying your idea using a regular mail merge. Is that what you were suggesting, or is there another type of merge I should be doing?

    Thanks

  14. #14
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    There is another possibility that may or may not work depending on how your worksheet is formatted. You can actually link to the Excel workbook cells involved and simply refresh the links if you have to do this repeatedly for different clients. The method for doing embedding depends on the version of Office you are using, but in general you are Inserting an Excel object into your Word document.
    Wendell

  15. #15
    5 Star Lounger Vincenzo's Avatar
    Join Date
    Mar 2004
    Posts
    654
    Thanks
    96
    Thanked 14 Times in 13 Posts
    I am trying it as Wendell suggested, by inserting linked Excel objects. It seems to work well, except that the inserted Excel objects, which are single cells from my spreadsheet, all appear with a box around them. This box is not a border on the table into which I am inserting the objects, that border is clear. (and if I make that table border visible, you can see the second border inside it).

    I've tried right clicking on the inserted object, and going to Border (it seems to refer to the inserted object as a picture, in the border dialog) but I've tried every options that I see there, cannot make the border around the inserted object go away.

    Any ideas?

    Thanks

Page 1 of 2 12 LastLast

Posting Permissions

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