บันทึกแมโคร สามารถกระชับโค้ดได้อีกมั้ยค่ะ
Posted: Thu Jun 14, 2018 10:21 am
Code: Select all
Sub à¤ÅÕÂÃì()
Range("A18:E36,D3:D17").Select
Selection.ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("A18:E36").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Color = -4165632
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Color = -4165632
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Color = -4165632
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Color = -4165632
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Color = -4165632
.TintAndShade = 0
.Weight = xlThin
End With
End Sub
เลยศึกษาเรื่องการบันทึกแมโคร
แล้วเอาโค้ดมาใส่ต่อๆกัน
อยากทราบว่าโค้ดด้านบนนี้สามารถกระชับโค้ดได้อีกมั้ยค่ะ
พอเวลาเรียกใช้แล้วมันกระพริบหลายทีค่ะ