G
gimme_this_gimme_that
Adapted from the recorder. What must be changed to create a border box
around boxrng?
Thanks.
Sub t()
Dim startcell As Range, endcell As Range, boxrng As Range
Dim b As Workbook
Dim s As Worksheet
Set b = ActiveWorkbook
Set s = b.Sheets("Sheet1")
Set startcell = s.Cells(2, 2)
Set endcell = s.Cells(5, 5)
Set boxrng = Range(startcell, endcell)
boxrng.Borders(xlDiagonalDown).LineStyle = xlNone
boxrng.Borders(xlDiagonalUp).LineStyle = xlNone
boxrng.Borders(xlEdgeLeft).LineStyle = xlContinous
boxrng.Borders(xlEdgeTop).LineStyle = xlContinuous
boxrng.Borders(xlEdgeBottom).LineStyle = xlContinous
boxrng.Borders(xlEdgeRight).LineStyle = xlContinuous
boxrng.Borders(xlInsideVertical).LineStyle = xlNone
boxrng.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
around boxrng?
Thanks.
Sub t()
Dim startcell As Range, endcell As Range, boxrng As Range
Dim b As Workbook
Dim s As Worksheet
Set b = ActiveWorkbook
Set s = b.Sheets("Sheet1")
Set startcell = s.Cells(2, 2)
Set endcell = s.Cells(5, 5)
Set boxrng = Range(startcell, endcell)
boxrng.Borders(xlDiagonalDown).LineStyle = xlNone
boxrng.Borders(xlDiagonalUp).LineStyle = xlNone
boxrng.Borders(xlEdgeLeft).LineStyle = xlContinous
boxrng.Borders(xlEdgeTop).LineStyle = xlContinuous
boxrng.Borders(xlEdgeBottom).LineStyle = xlContinous
boxrng.Borders(xlEdgeRight).LineStyle = xlContinuous
boxrng.Borders(xlInsideVertical).LineStyle = xlNone
boxrng.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub