Sub Start()
Call BaoCaoNhapXuatTon
Call TrangTriBangTinh
End Sub
Sub TrangTriBangTinh()
Dim sArray, r As Integer
With Sheets("BC")
sArray = .Range(.[A5], .[A65536].End(xlUp)).Resize(, 8)
r = UBound(sArray, 1)
.Range("A5:H65536").ClearFormats
'Ke khung cho bang tinh
With .Range("A5:" & "H" & r + 4)
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.VerticalAlignment = xlCenter
End With
'To mau vung chon
With .Range("A5:" & "E" & r + 4).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
'Dinh dang cot E,F,G,H
.Range("E5:" & "H" & r + 4).NumberFormat = "#,##0.00"
End With
End Sub