Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Expand RowHeight for merged cells (Excel 2002)

    Hi

    Using code supplied in the lounge i have tried to get the row height to expand with no success.

    Please see attached spreadsheet.

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    Try and modify the line If ActiveCell.MergeCells Then
    to
    If ActiveCell.MergeCells = False Then
    Regards,
    Rudi

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Expand RowHeight for merged cells (Excel 2002)

    The code works, but you haven't set Wrap Text for the merged cell. The check mark is gray, make sure it is black. you set this in the Alignment tab of Format | Cells.

  4. #4
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    Hi Rudi

    Tried what you suggested, still not working.

    Braddy
    If you are a fool at forty, you will always be a fool

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    Hi Hans


    Thanks very much for that.


    Braddy
    If you are a fool at forty, you will always be a fool

  6. #6
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    My apologies Braddy;
    Remove the = False, as I notice that your post title requires it to wrap on merged cells. I didn't note that before!
    As Hans says, the code works...you can only run it on merged cells that are wrapped!
    Regards,
    Rudi

  7. #7
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    HI Rudi

    No apologies necesarry I am always grateful for any input,

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  8. #8
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    Hi Hans

    Regarding this post I now have the code working but is stops expanding when the row height gets to 76.5 I didn't think there was a maximum row height or is it defined by the code.


    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Expand RowHeight for merged cells (Excel 2002)

    The maximum row height is 409.5 points. The code will increase the row height well beyond 76.5 points for me, but you must be aware that Excel only displays 1,024 characters in a cell (the formula bar will display more characters, up to the maximum of 32,767). So if your cell contains more than 1,024 characters, the code will only adjust the height to fit the first 1,024 characters.

  10. #10
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Expand RowHeight for merged cells (Excel 2002)

    Hi Hans

    I have resolved the problem by reducing the amount of merged cells. it expanded beyond the dotted line which denotes the print area.

    At least I think that was problem by adjusting the range inside the line it seemed to work OK.

    NB: For anyone following this thread who has limited knowledge like me, you might be interested to know that
    I discovered by dupilcating and renaming the code I can apply it to more than one set of merged cells in the same worksheet

    Once again

    Thanks Hans

    Braddy
    If you are a fool at forty, you will always be a fool

  11. #11
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Expand RowHeight for merged cells (Excel 2002)

    You could just have 1 copy of the code,

    You can called it from code that first set the activecell as desired.

    Alternately, you could make it a function and use a cell reference as a parameter and just call it, giving it the range to act on. In this case you would change the "ActiveCell" bits of the code to the range object...

    Steve

Posting Permissions

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