關於跨欄置中和框線畫線是否有比較簡易的寫法(謝謝各位大大,已解決。)
- 帖子
- 51
- 主題
- 0
- 精華
- 0
- 積分
- 81
- 點名
- 0
- 作業系統
- Win 7
- 軟體版本
- Office 2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2012-3-9
- 最後登錄
- 2013-1-9
|
本帖最後由 alexliou 於 2012-4-24 19:09 編輯
在一張工作表裡
可能有好幾個地方要畫粗外框線和跨欄置中
我現在都將畫框線和跨欄置中寫成 函式
引數是 Range 物件
每次要畫框線或跨欄置中時
就去呼叫函式 ex. Call 畫粗外框(Range("A1:A10"))
省得重複一堆 Code |
|
|
Alex
|
|
|
|
|
- 帖子
- 51
- 主題
- 0
- 精華
- 0
- 積分
- 81
- 點名
- 0
- 作業系統
- Win 7
- 軟體版本
- Office 2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2012-3-9
- 最後登錄
- 2013-1-9
|
回復 6# GBKEE
這只是把畫粗外框的code集合在一起而已
Sub 畫粗外框(oRrange As Range)
oRange.Borders(xlDiagonalDown).LineStyle = xlNone
oRange.Borders(xlDiagonalUp).LineStyle = xlNone
With oRange.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.Weight = xlMedium
End With
With oRange.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.Weight = xlMedium
End With
With oRange.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.Weight = xlMedium
End With
With oRange.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.Weight = xlMedium
End With
oRange.Borders(xlInsideVertical).LineStyle = xlNone
oRange.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
如要更彈性一點, 可將框線的粗細,顏色都設成引數 |
|
|
Alex
|
|
|
|
|