Consulting

Results 1 to 5 of 5

Thread: Trouble when cell spans 2 pages

  1. #1
    VBAX Regular
    Joined
    Aug 2016
    Posts
    10
    Location

    Question Trouble when cell spans 2 pages

    I have a Word Table with a number of rows that start out with just 1 cell. These rows, I have code to move down one row (to a row that contains multiple cells) and add a row above so that it contains all of the columns. I then use a copy of the text that is in the single cell into the first cell. The code then selects the entire row and merges it into 1 cell that spans all of the columns in the table.
    This code works fine in MOST cases. However, if the original single cell is at the end of the page and continues to the next page moving down 1 row moves the cursor to the 2nd row of text in the same row instead of moving down to the row below that has the multiple rows. How do I test for this possibility so that I can move down another row? Would the row number be the same when I move to the 2nd page?


    Chris

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,619
    Location
    Can the table be on its own page? With PageBreakBefore and PageBreak after?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Aug 2016
    Posts
    10
    Location
    That's another problem with this table: it takes up more than a single page. However, even if it wasn't this long, we are unable to place the table on its own page because some of the tables are only 3-4 lines long.

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,619
    Location
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,311
    Location
    Quote Originally Posted by chrscote View Post
    I have code to move down one row (to a row that contains multiple cells) and add a row above so that it contains all of the columns. I then use a copy of the text that is in the single cell into the first cell. The code then selects the entire row and merges it into 1 cell that spans all of the columns in the table.
    It's impossible to advice on any specific improvements to your code without seeing it. If you post it, preferably together with an attached document that contains a sample table, doubtless someone will be able to advise.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

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