
ตัวอย่างการปรับ Code ครับ
Code: Select all
Sub WallOutsideLong()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If Cells(38, "C").Value = True Then
Cells(38, "C").RowHeight = 20
Cells(38, "e").Value = 0
Else
Cells(38, "C").RowHeight = 0
Cells(38, "e").Value = 0
End If
If Cells(39, "C").Value = True Then
Cells(39, "C").RowHeight = 20
Cells(39, "e").Value = 0
Else
Cells(39, "C").RowHeight = 0
Cells(39, "e").Value = 0
End If
If Cells(40, "C").Value = True Then
Cells(40, "C").RowHeight = 20
Cells(40, "e").Value = 0
Else
Cells(40, "C").RowHeight = 0
Cells(40, "e").Value = 0
End If
If Cells(41, "C").Value = True Then
Cells(41, "C").RowHeight = 20
Cells(41, "e").Value = 0
Else
Cells(41, "C").RowHeight = 0
Cells(41, "e").Value = 0
End If
If Cells(42, "C").Value = True Then
Cells(42, "C").RowHeight = 20
Cells(42, "e").Value = 0
Else
Cells(42, "C").RowHeight = 0
Cells(42, "e").Value = 0
End If
If Cells(43, "C").Value = True Then
Cells(43, "C").RowHeight = 20
Cells(43, "e").Value = 0
Else
Cells(43, "C").RowHeight = 0
Cells(43, "e").Value = 0
End If
If Cells(44, "C").Value = True Then
Cells(44, "C").RowHeight = 20
Cells(44, "e").Value = 0
Else
Cells(44, "C").RowHeight = 0
Cells(44, "e").Value = 0
End If
If Cells(45, "C").Value = True Then
Cells(45, "C").RowHeight = 20
Cells(45, "e").Value = 0
Else
Cells(45, "C").RowHeight = 0
Cells(45, "e").Value = 0
End If
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub