- 帖子
- 31
- 主題
- 12
- 精華
- 0
- 積分
- 69
- 點名
- 0
- 作業系統
- WIN XP
- 軟體版本
- OFFICE 2003
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2011-8-19
- 最後登錄
- 2016-1-2
|
各位大大好
以下是我錄製的程式碼
我想在'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
複製代碼 |
|