會員登錄 - 用戶注冊 - 網(wǎng)站地圖 Office中國(office-cn.net),專業(yè)Office論壇
當(dāng)前位置:主頁 > 技巧 > Excel技巧 > 操作 > 正文

為選擇的區(qū)域添加邊框

時間:2013-07-02 23:42 來源:Office中國 作者:Access中國錄入員 閱讀:
Sheets("Reference").Select
    Range("d9").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    
    Dim myBorders() As Variant, item As Variant
    myBorders = Array(xlEdgeLeft, _
                      xlEdgeTop, _
                      xlEdgeBottom, _
                      xlEdgeRight, _
                      xlInsideVertical)
    For Each item In myBorders
        With Selection.Borders(item)
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
        End With
    Next item

(責(zé)任編輯:admin)

頂一下
(0)
0%
踩一下
(0)
0%
發(fā)表評論
請自覺遵守互聯(lián)網(wǎng)相關(guān)的政策法規(guī),嚴(yán)禁發(fā)布色情、暴力、反動的言論。
評價: