Apply basic formatting: Lock Headers, AutoFilter, AutoFit
Public Function FormatStandard(myTab As Long)
'-----------------------------------------------------------------------------------------
'Selects desired worksheet, applys formats and returns to current worksheet when finished
'Formatting Standards: Lock Headers, Apply Filters, Autofit, Remove WrapText
'-----------------------------------------------------------------------------------------
Dim iCurrentWs As Long
iCurrentWs = ActiveSheet.Index
'-------------------------------------------------------------------------
'Freeze Header, Fix Header Fields
Sheets(myTab).Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True
Application.CutCopyMode = False
Cells.Select
Selection.AutoFilter
'-------------------------------------------------------------------------
'Autofit columns
Cells.Select
Cells.EntireColumn.AutoFit
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A2").Select
'-------------------------------------------------------------------------
Worksheets(iCurrentWs).Select
End Function
'-----------------------------------------------------------------------------------------
'Selects desired worksheet, applys formats and returns to current worksheet when finished
'Formatting Standards: Lock Headers, Apply Filters, Autofit, Remove WrapText
'-----------------------------------------------------------------------------------------
Dim iCurrentWs As Long
iCurrentWs = ActiveSheet.Index
'-------------------------------------------------------------------------
'Freeze Header, Fix Header Fields
Sheets(myTab).Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True
Application.CutCopyMode = False
Cells.Select
Selection.AutoFilter
'-------------------------------------------------------------------------
'Autofit columns
Cells.Select
Cells.EntireColumn.AutoFit
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A2").Select
'-------------------------------------------------------------------------
Worksheets(iCurrentWs).Select
End Function