+ Reply to Thread
Results 1 to 3 of 3

VBA to autofit only the row of the active cell

  1. #1
    Registered User
    Join Date
    10-19-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2016
    Posts
    10

    VBA to autofit only the row of the active cell

    Hello, everyone,

    I am looking for code to autofit the row of the active cell of a table (Table1) and return the row to its fixed height (15) when the cell is deselected.

    (Note: I want to leave text-wrapping in place for all table cells so that blank cells are easily identifiable.)

    Thanks for your help.

  2. #2
    Banned User!
    Join Date
    01-17-2021
    Location
    Omaha, NE
    MS-Off Ver
    office 2016
    Posts
    211

    Re: VBA to autofit only the row of the active cell

    for fullfilling the subject, you would do this behind the sheet
    Please Login or Register  to view this content.
    to return row to 15 height, store the row number or a range cell that has the row number included in it. then set the height to 15.

  3. #3
    Registered User
    Join Date
    10-19-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2016
    Posts
    10

    Re: VBA to autofit only the row of the active cell

    Thank you. BTW, I just now located the long-lost workbook in which I had done it another way:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Range("Table1").RowHeight = 15
    Selection.Rows.AutoFit
    End Sub

+ 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. Replies: 2
    Last Post: 03-13-2020, 05:28 AM
  2. [SOLVED] Simple macro/VBA to copy cell above active cell and then move active cell one right...
    By planetjed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2018, 02:02 PM
  3. [SOLVED] If active cell value dosn't match in range then highlight the active cell
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2017, 12:38 AM
  4. [SOLVED] Can I determine the effect of autofit to .columnwidth prior to executing the autofit?
    By kadeo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2016, 10:29 AM
  5. Need macro to autofit multiple cells not just active cell
    By Triscia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2013, 01:29 PM
  6. Replies: 2
    Last Post: 12-23-2012, 09:26 AM

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