none
How do you format a table to have banded rows when some rows contain vertically split cells? RRS feed

  • Question

  • I've got a table like the one below:

    Note that, in the last 3 columns, for both the "Get screen coordinates of a specified text range" row and the "Highlight specified (non-bookmark) text range" row, the cells are split vertically into two cells.  I want all the cells which are associated with the first column of the row to be the same color (for example, I want all 8 cells associated with "Get screen coordinates of a specified text range" to be shaded blue, and all 8 cells associated with "Highlight specified (non-bookmark) text range" to be shaded with no background).  Is there a simple way to do this (I'd rather not have to make a macro for this).


    Dan
    Saturday, October 15, 2011 3:16 PM

All replies

  • Hi Dan,

    Since you don't want to do this with a macro, you might get more help from the Microsoft Answers forum.

    http://answers.microsoft.com/en-us/office/forum/word


    Kind Regards, Rich ... http://greatcirclelearning.com
    Sunday, October 16, 2011 2:28 AM
  • Well--if someone's got a macro to do this, I'd happily use it. :)

     


    Dan
    Tuesday, October 18, 2011 4:35 PM
  • Hi Dan,

    Thank you for posting.

    After reading your problem, I am still not clear about your problem.

    >>Note that, in the last 3 columns, for both the "Get screen coordinates of a specified text range" row and the "Highlight specified (non-bookmark) text range" row, the cells are split vertically into two cells

    I can see the "Get screen coordinates of a specified text range" row, but where is the "the "Highlight specified (non-bookmark) text range" row"?

    >> I want all the cells which are associated with the first column of the row to be the same color

    What do you mean about the "all the cells which are associated with teh first column of the row"? How are the cells being associated?

    >>for example, I want all 8 cells associated with"Get screen coordinates of a specified text range" to be shaded blue, and all 8 cells associated with "Highlight specified (non-bookmark) text range" to be shaded with no background

    What are the 8 cells? Could you give me more specific information about the 8 cells?

    You can use the following macro to set the background of the cells:

    Sub Macro2()
        Selection.Shading.Texture = wdTextureNone
        Selection.Shading.ForegroundPatternColor = wdColorAutomatic
        Selection.Shading.BackgroundPatternColor = -553582797
    End Sub
    Hope this can help you and I will do further research with your detailed information.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, October 19, 2011 3:33 AM
  •  

    >> I can see the "Get screen coordinates of a specified text range" row, but where is the "the "Highlight specified (non-bookmark) text range" row"?

    Sorry.  That should read: "Remove specified text range from document".  It's column 1, row 1 in the screenshot.

    >> What do you mean about the "all the cells which are associated with teh first column of the row"? How are the cells being associated?

    Logically, each row contains 1 cell each in columns 1 and 2, and 2 cells each in columns 3, 4, and 5.  For example, in the row where the first column is "Remove specified text range from document", column 2 of the row  is "Delete a range of text, given...", column 3 of the row contains two cells-- "ESMTAddin" and "EditScriptMT", column 4 of the row contains two cells--"clsEditScriptDoc" and "clsDocument", and column 5 of the row contains two cells--"RemoveTextAfterSegment" and "RemovePreviousSplitSegment".  All of the cells described here are associated with the first column of the row.

    >>What are the 8 cells? Could you give me more specific information about the 8 cells?

    In the description above, there are 8 cells in the row: 1 in column 1, 1 in column 2, and 2 each in columns 3, 4, and 5.

     

      
    Dan
    Thursday, October 20, 2011 2:29 PM
  • Bruce--note also that, in some of these "logical rows", columns 3, 4, and 5 could contain only 1 cell each--or, conceivably, they could each contain more than 2 cells each.  The important thing is that columns 3, 4, and 5 always contain the same number of cells: in essence, these columns compose sub-rows which are children to the parent row owned by the cell in column 1.
    Dan
    Thursday, October 20, 2011 2:32 PM
  • Hi Dan,

    Does the vba code snippet help you? You can select the rows or cells and then set the background color through running the macro :

    Sub Macro2()
    Selection.Shading.Texture = wdTextureNone
    Selection.Shading.ForegroundPatternColor = wdColorAutomatic
    Selection.Shading.BackgroundPatternColor = -553582797
    End Sub

    Hope this can help you.

    Best Regards, 


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Bruce Song Friday, October 21, 2011 7:00 AM
    Friday, October 21, 2011 6:59 AM
  • Hi Dan,

    How about the problem on your side? If you still show any concern on the problem, just feel free to let us know.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, October 26, 2011 8:48 AM