Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified 7/26/2019 8:29:43 PM EDT
If Target.Value <> "" Then
Cancel = True
With Rows(Target.Row)
Select Case Rows(Target.Row).RowHeight
Case Is = 12.75
.RowHeight = 75
Case Is = 75
.RowHeight = 12.75
End Select
End With
End If
End Sub
Option Explicit
Private LastAlteredRow As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If LastAlteredRow > 0 Then Rows(LastAlteredRow).RowHeight = 12.75
If ActiveCell.Column = 5 Then '5 = column E, adjust this to your required column
ActiveCell.EntireRow.AutoFit
LastAlteredRow = ActiveCell.Row
End If
End Sub
Private cmt As Comment
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim currentWidth As Double, currentHeight As Double
Dim expandedWidth As Double, expandedHeight As Double
On Error Resume Next
If Not cmt Is Nothing Then cmt.Delete
On Error GoTo 0
If Target.Count > 1 Or Target(1, 1).Value = "" Then Exit Sub
currentWidth = Target.ColumnWidth
currentHeight = Target.RowHeight
Application.ScreenUpdating = False
Target.EntireColumn.AutoFit
Target.EntireRow.AutoFit
expandedWidth = Target.ColumnWidth
expandedHeight = Target.RowHeight
Target.ColumnWidth = currentWidth
Target.RowHeight = currentHeight
Application.ScreenUpdating = True
If expandedWidth > currentWidth Or expandedHeight > currentHeight Then
If Target.Comment Is Nothing Then
Set cmt = Target.AddComment(Target.Value)
cmt.Shape.TextFrame.AutoSize = True
End If
End If
End Sub