• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Autofit row when clicking in it

schayer

New Member
Whitin a specific range N44 to N4130, only the first few words in each cell is visible. if the user clicks on a cell, that row autofits to show the entire text in it. And remains that way, but the user can also click on other cells within that range with the same result.
 
schayer
Based Your writing
Copy below code to that sheet's code-page
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    h = Range("N5000").RowHeight
    With Target
        ay = .Row
        If .Column = 14 And ay >= 44 And ay <= 4130 Then
            If h = .RowHeight Then
                .EntireRow.AutoFit
            Else
                .EntireRow.RowHeight = h
            End If
        End If
    End With
End Sub
 
Back
Top