Вот пример, не проверенный:
Sub BordersAndFilters()
Dim ws As Worksheet
Dim aBorderSettings() As Long 'Calls the array
Dim i As Long
Set ws = ThisWorkbook.Worksheets("Data") 'your worksheet name
ReDim aBorderSettings(1 To 8, 1 To 2) 'An Array of length 8x2 (table)
aBorderSettings(1, 1) = xlDiagonalDown: aBorderSettings(1, 2) = xlNone
aBorderSettings(2, 1) = xlDiagonalUp: aBorderSettings(2, 2) = xlNone
aBorderSettings(3, 1) = xlEdgeBottom: aBorderSettings(3, 2) = xlContinuous
aBorderSettings(4, 1) = xlEdgeLeft: aBorderSettings(4, 2) = xlNone
aBorderSettings(5, 1) = xlEdgeRight: aBorderSettings(5, 2) = xlNone
aBorderSettings(6, 1) = xlEdgeTop: aBorderSettings(6, 2) = xlNone
aBorderSettings(7, 1) = xlInsideHorizontal: aBorderSettings(7, 2) = xlNone
aBorderSettings(8, 1) = xlInsideVertical: aBorderSettings(8, 2) = xlNone
With ws.Range("A2:E" & ws.Cells(ws.Rows.Count, "E").End(xlUp).Row) 'Instead of using LastRow. The "E" should be your column with guaranteed values in every row.
'Filter and Fit
.AutoFilter 'remove this if you don't want to filter
.EntireColumn.AutoFit 'remove this if you don't want to fit the cells to column width
'For every number in the array, change the borders based on the values in the array
For i = LBound(aBorderSettings, 1) To UBound(aBorderSettings, 1)
.Borders(aBorderSettings(i, 1)).LineStyle = aBorderSettings(i, 2)
If aBorderSettings(i, 2) <> xlNone Then
.Borders(aBorderSettings(i, 1)).ColorIndex = xlAutomatic
.Borders(aBorderSettings(i, 1)).TintAndShade = 0
.Borders(aBorderSettings(i, 1)).Weight = xlThin
End If
Next i
End With
End Sub