+ Reply to Thread
Results 1 to 4 of 4

Autofit Row Height with Wrap Text - Automatically in Real Time

  1. #1
    Registered User
    Join Date
    07-26-2006
    MS-Off Ver
    Office 365
    Posts
    97

    Autofit Row Height with Wrap Text - Automatically in Real Time

    I am trying to get Excel to autofit to row height based on the length of text I am typing into a cell. I have Wrap Text turned on, but as I type text into the cell, I need it to adjust automatically.

    I am aware of the Home(ribbon)-> Cells(section) > Format - Autofit Row Height but that is technically not "automatic". I know about the double-clicking between the row numbers as well as the shortcut Alt+H+O+I, but again, these steps remove the "automatic" from what I need.

    Is there another setting I am not aware of? Is this a macro issue?

    Any feedback helps. Thank you.

  2. #2
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: Autofit Row Height with Wrap Text - Automatically in Real Time

    Open the workbook, press Alt+F11, right click on the sheet (you want to apply auto fit. You can select this workbook to apply to the entire workbook) select view code, select workbook from the drop down menu. and type this line Cells.EntireColumn.AutoFit between the lines which are auto displayed like this
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.EntireColumn.AutoFit

    End Sub

  3. #3
    Registered User
    Join Date
    07-26-2006
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Autofit Row Height with Wrap Text - Automatically in Real Time

    Thank you Rajesh! That works for what I need. Technically I needed the rows to autofit, so I just changed the code to Cells.EntireRow.Autofit and it works as intended. Thank you for the detailed instruction as well.

  4. #4
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: Autofit Row Height with Wrap Text - Automatically in Real Time

    Glad I could help

+ 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. Help with Wrap Text and AutoFit Row Height between multiple sheets
    By joesparkie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-16-2020, 08:32 PM
  2. [SOLVED] How to AutoFit Row Height for Certain Cell with Text Wrap?
    By putritersenyum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2016, 07:50 AM
  3. Replies: 2
    Last Post: 03-16-2012, 03:06 AM
  4. Automatically Resize Row Height for Text Wrap
    By driffert in forum Excel General
    Replies: 0
    Last Post: 02-25-2009, 10:28 AM
  5. Text wrap and allow cell height to increase with wrap
    By tpenterprize in forum Excel General
    Replies: 1
    Last Post: 10-19-2007, 02:30 PM
  6. [SOLVED] Possible to automatically autofit row height to text in Excel?
    By PSIUser in forum Excel General
    Replies: 0
    Last Post: 06-27-2006, 03:55 PM
  7. Text Wrap, Cell Height Does NOT Automatically Adjust
    By Al Franz in forum Excel General
    Replies: 1
    Last Post: 01-24-2005, 10:07 PM

Tags for this Thread

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