Sub AAC_Recreate_Info_Sheet()
' Keyboard Shortcut: Ctrl+Shift+D
On Error GoTo Error_Handler
10: FLAG = True
100: CB_FLAG = 7
' Make code go faster
200: Call OptimizeCode_Begin
' Check to see if info sheet exists
300: Call Check_For_Info_Sheet: If FLAG = False Then Call OptimizeCode_End: Exit Sub
400: Call Fresh_Info_Sheet: If FLAG = False Then Call OptimizeCode_End: Exit Sub
' Clear out 100 cells deep for new info and header rows
500: Sheets("Cover").Range("J11:M113").ClearContents
' Because it screwed up once the number format is reset
600: Sheets("Cover").Range("J11:M242").NumberFormat = "General"
700: Sheets("Cover").Range("J11").Value = "Amp Usage Total"
800: Sheets("Info").Range("B2").Value = "Amp Usage Total"
' Header
900: Sheets("Cover").Range("J13").Value = "CB"
1000: Sheets("Info").Range("B4").Value = "CB"
' Headers for columns
1100: Sheets("Cover").Range("K13").Value = "Total for CB"
1200: Sheets("Info").Range("C4").Value = "Total for CB"
1300: Sheets("Cover").Range("L13").Value = "Input"
1400: Sheets("Info").Range("D4").Value = "Input"
1500: Sheets("Cover").Range("M13").Value = "Output"
1600: Sheets("Info").Range("E4").Value = "Output"
1700: A = 5
' Scan all the worksheets
1800: For Each WS In ThisWorkbook.Worksheets
' Check if the worksheet is an is list
1900: If Format(Left(Application.Proper(WS.Name), 2), ">") = "IO" Then
' Get the right three digits which will be the number
2000: Sheets("Info").Range("B" & A).Value = Right(Application.Proper(WS.Name), 3)
2100: Sheets("Cover").Range("J" & A + 9).Value = Right(Application.Proper(WS.Name), 3)
' For the first loop put the number in the variable
2200: If A = 5 Then FIRST_CB_NMBR = Right(Application.Proper(WS.Name), 3)
' Update the number each loop through so we can get the name of the last io list
2300: LAST_CB_NMBR = Right(Application.Proper(WS.Name), 3)
' Get ready in the next cell down on the Info sheet
2400: A = A + 1
2500: End If
2600: Next WS
2700: Call Create_Info_Sheet: If FLAG = False Then Call OptimizeCode_End: Exit Sub
2800: Call Create_Formulas: If FLAG = False Then Call OptimizeCode_End: Exit Sub
2900: Call Save_To: If FLAG = False Then Call OptimizeCode_End: Exit Sub
3000: Call CLEANER
3100: Call OptimizeCode_End
3200: ThisWorkbook.UpdateLink Name:=ThisWorkbook.LinkSources
3300: Exit Sub
Error_Handler:
Call OptimizeCode_End
TEST = MsgBox("Re_Create_Info_Sheet Malfunctioned." & vbCrLf & _
"Error Number - " & Err.Number & vbCrLf & "Error Source - " & Err.Source & _
vbCrLf & "Error Description - " & Err.Description & _
vbCrLf & "Error Line: " & Erl & vbCrLf & "Help File - " & Err.HelpFile & _
vbCrLf & "Context - " & Err.HelpContext, vbOKOnly + vbCritical)
End Sub