+ Reply to Thread
Results 1 to 15 of 15

How to AutoFit Row Height Merge Cells Automatically on Change?

  1. #1
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    How to AutoFit Row Height Merge Cells Automatically on Change?

    Please, help me to make automatic autofit row height on merge cells changed.

    this thread following on from http://www.excelforum.com/showthread...t=#post4446560 autofit for not merged cells.

    on the same row I have some data that must be autofit, how to prevent the little data change row size of the much data? or two code work will alternate the amount of data.
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    Maybe :

    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    @karedog
    your code just works for autofit without merged cells.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    Really ?
    Try these steps :
    - Press del (delete) cell A5
    - Autofit entire row 5 manually
    - Run the macro

  5. #5
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    Thanks your code works well. But it works manually. Would you like to modify it to run automatically when there is a change, like this one http://www.excelforum.com/showthread...t=#post4446560

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    Put this code in Sheet1 module :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    @karedog
    Thanks a lot, your code works very well. And it will make me work more fun.

  8. #8
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    But I have some Sheets, why the size of the other rows are same as Sheet1? So, my data on the others Sheets that have many words can't be shown.

    edited
    sorry, it is influenced by the size of the zoom and the problem is solved
    Last edited by putritersenyum; 08-05-2016 at 05:41 AM.

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    You are welcome, thanks for marking the thread as solved and for the rep.points.


    Regards

  10. #10
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    @karedog
    would you like to make your code run automatically on the value of cell is changed without press enter button from the cells (auto trigger)?

  11. #11
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    You mean the row autofit is triggered when you are typing on the cell ?

    This is not possible, because no macro can be run while you are editing a cell (edit mode), this is designed this way by Microsoft.
    What you can do is, before you edit/type something on cell, change the row height big enough as you predicted the text will be fit, then do the editing/typing. As soon as you finish editing/typing (by pressing enter or click on other cell), the macro will immediately do the autofit for you.

  12. #12
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    @karedog
    Sorry, I mean the row autofit value changed by another cell.
    For the explanation, please try this file:
    Attached Files Attached Files

  13. #13
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    First, you need to delete all the code in ThisWorkbook module (Sub Workbook_SheetChange())

    Then change the code on Sheet1 module to this :
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    @karedog
    Thanks so much, that really works great.

  15. #15
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: How to AutoFit Row Height Merge Cells Automatically on Change?

    You are welcome, glad to help.


    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] AutoFit Row Height Automatically on Changed
    By putritersenyum in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-02-2016, 09:55 AM
  2. [SOLVED] How to AutoFit Row Height Merge Cells?
    By putritersenyum in forum Excel General
    Replies: 4
    Last Post: 04-14-2016, 10:52 AM
  3. AutoFit Row Height for merged cells
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2014, 07:03 PM
  4. [SOLVED] Row height using autofit, with no merged cells
    By D.Smith in forum Excel General
    Replies: 1
    Last Post: 07-02-2006, 06:51 AM
  5. Replies: 0
    Last Post: 06-27-2006, 03:55 PM
  6. Autofit row height in merged cells
    By BobT in forum Excel General
    Replies: 1
    Last Post: 02-25-2005, 01:06 PM
  7. Autofit of Row Height with Merged Cells - AGAIN!
    By Paige in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-14-2005, 03:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1