標題:
[發問]
請問各位大大,如何簡化以下程式
[打印本頁]
作者:
alex520188
時間:
2012-7-13 14:08
標題:
請問各位大大,如何簡化以下程式
各位大大好
以下是我錄製的程式碼
我想在'A12:L44'畫框線
不過程式好像有點長
請問要如何簡化呢?
Sub 畫格線2()
'
' 畫格線2 Macro
' alex 在 2012/7/13 錄製的巨集
'
Range("A12:L44").Select
ActiveWindow.SmallScroll Down:=-12
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
複製代碼
作者:
oobird
時間:
2012-7-13 14:16
Sub 畫格線2()
[A12:L44].Borders.LineStyle = 1
End Sub
複製代碼
作者:
alex520188
時間:
2012-7-13 17:58
回復
2#
oobird
感謝超級版主~~~原來這麼簡單 ^-^
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)