Answers for "excel vba cell border"

VBA
0

vba cell all borders

' set "All Boarders" around a range
ActiveSheet.Range("A1:C3").Borders.LineStyle = xlContinuous
Posted by: Guest on October-03-2020
1

excel vba set range borders like grid

'VBA routine to set the grid borders THROUGHOUT a range:

Sub SetRangeGrid(r As Range, Optional stl = 1, Optional clr = 0, Optional wgt = 2)
    With r.Borders()
        .LineStyle = stl
        .Color = clr
        .Weight = wgt
    End With
End Sub

'--------------------------------------------------------------------

SetRangeBorder [d2:k10]
SetRangeBorder [d2:k10], vbRed
SetRangeBorder [d2:k10], , xlThick
Posted by: Guest on March-30-2020
0

excel vba borders

Dim wksWorksheet As Worksheet, rRange As Range
Set wksWorksheet = ThisWorkbook.Worksheets(1)
Set rRange = wksWorksheet.Range("A1:D10")
' All borders
With rRange.Borders
    .LineStyle = xlContinuous
    .Color = vbRed
    .Weight = xlThin
End With
' Outside borders
rRange.BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic
' Inside
With rRange.Borders.Item(xlInsideHorizontal)
    .ColorIndex = 5
    .LineStyle = xlContinuous
    .Weight = xlThin
End With
Posted by: Guest on January-14-2021
0

excel vba table border

Sub SetRangeBorder() 
 
 With Worksheets("Sheet1").Range("B2").Borders(xlEdgeBottom) 
 .LineStyle = xlContinuous 
 .Weight = xlThin 
 .ColorIndex = 3 
 End With 
 
End Sub
Posted by: Guest on May-06-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language