본문 바로가기

카테고리 없음

g

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim ir As Long, ic As Integer
Dim ih As Double
Application.ScreenUpdating = False
ih = 18 ' 기본 행높이
ir = Me.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
ic = Me.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Me.UsedRange.Offset(2).RowHeight = ih
With Target
If .Row >= 2 And .Row <= ir And .Column <= ic Then
.EntireRow.AutoFit
If .RowHeight <= ih Then
.EntireRow.RowHeight = ih + 15
Else
.EntireRow.AutoFit
End If
Else
Me.UsedRange.Offset(2).RowHeight = ih
End If
.Offset(1).Select
End With
Application.ScreenUpdating = 1
End Sub