XLA routines: EE_FinalFormatSheet

Nick's picture
EE_FinalFormatSheet is a good sub routine to use when creating a set of results to clean up the sheet
Sub EE_FinalFormatSheet(strSheetName As String)
'Takes a sheet name as string
'If sheet doesn't exist, exit sub
'Sub autofits the cols
'Selects A2
'Freezes Panes

'http://excelexperts.com/xla-routines-eeFinalFormatSheet    for updates on this sub routine

    Dim wksActive As Worksheet
 
    Set wksActive = ThisWorkbook.ActiveSheet
 
    If EE_SheetExists(strSheetName) = True Then
        With ThisWorkbook.Worksheets(strSheetName)
            .Cells.EntireColumn.AutoFit
            Application.GoTo .range("A2")
            ActiveWindow.FreezePanes = True
        End With
    End If
 
    wksActive.Activate
    Set wksActive = Nothing
End Sub