Private Sub CellBorder(WorkSheet As Excel.Worksheet, StartRow As Integer, StartClm As Integer, EndClm As Integer, EndRow As Long)
With WorkSheet.Range(WorkSheet.Cells(StartRow, StartClm), WorkSheet.Cells(EndRow, EndClm)) 'Excel.XlCellType.xlCellTypeLastCell
.Borders(5).LineStyle = -4142 '.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(6).LineStyle = -4142
With .Borders(7)
.LineStyle = 1
.ColorIndex = 0
.Weight = 2
End With
With .Borders(8) 'xlEdgeTop
.LineStyle = 1 'xlContinuous
.ColorIndex = 0
.Weight = 2 'xlThin
End With
With .Borders(9) 'xlEdgeBottom
.LineStyle = 1 ' xlContinuous
.ColorIndex = 0
.Weight = 2
End With
With .Borders(10) 'xlEdgeRight
.LineStyle = 1
.ColorIndex = 0
.Weight = 2
End With
With .Borders(11) 'xlInsideVertical
.LineStyle = 1
.ColorIndex = 0
.Weight = 2
End With
With .Borders(12) 'xlInsideHorizontal
.LineStyle = 1
.ColorIndex = 0
.Weight = 2
End With
End With
End Sub