Else
'==================================================================
'==================================================================
'==================================================================
'Process B
'Sub MOD_36()
'
'IF BLANKS ARE FOUND IN COLUMN O THEN RUN CODE FOR Sub MOD_36B()
'Multiple steps are automated to cut down time expended by the analyst during forecasting efforts
'-----------------------------------------------------------'
'THIS SECTION HIDES ALL THE COLUMNS THAT WE DON'T NEED TO SEE DURING C-SYSTEM CALCULATION EFFORTS
Columns("B:B").Select
Range("B4").Activate
Selection.EntireColumn.Hidden = True
Columns("C:C").Select
Range("C4").Activate
Selection.EntireColumn.Hidden = True
Columns("D:D").Select
Range("D4").Activate
Selection.EntireColumn.Hidden = True
Columns("E:E").Select
Range("E4").Activate
Selection.EntireColumn.Hidden = True
Columns("F:F").Select
Range("F4").Activate
Selection.EntireColumn.Hidden = True
Columns("H:H").Select
Range("H4").Activate
Selection.EntireColumn.Hidden = True
Columns("J:J").Select
Range("J2").Activate
Selection.EntireColumn.Hidden = True
Columns("K:K").Select
Range("K2").Activate
Selection.EntireColumn.Hidden = True
Columns("L:L").Select
Range("L2").Activate
Selection.EntireColumn.Hidden = True
Columns("M:M").Select
Range("M2").Activate
Selection.EntireColumn.Hidden = True
Columns("N:N").Select
Range("N2").Activate
Selection.EntireColumn.Hidden = True
Columns("O:O").Select
Range("O2").Activate
Selection.EntireColumn.Hidden = True
Columns("P:P").Select
Range("P2").Activate
Selection.EntireColumn.Hidden = True
Columns("Q:Q").Select
Range("Q2").Activate
Selection.EntireColumn.Hidden = True
Columns("R:R").Select
Range("R2").Activate
Selection.EntireColumn.Hidden = True
Columns("S:S").Select
Range("S2").Activate
Selection.EntireColumn.Hidden = True
Columns("U:U").Select
Range("U2").Activate
Selection.EntireColumn.Hidden = True
Columns("V:V").Select
Range("V2").Activate
Selection.EntireColumn.Hidden = True
Columns("W:W").Select
Selection.EntireColumn.Hidden = True
'-----------------------------------------------------------
'THIS SECTION INSERTS THE HEADERS FOR AE, AF and AG - THE COLUMNS THAT WILL SOON HOLD FORMULAS AND CALCULATIONS
'THIS SECTION ALSO INSERTS THE FORMULAS TO PERFORM THE CALCULATIONS
Range("AE4").Select
ActiveCell.FormulaR1C1 = "y1"
Range("AF4").Select
ActiveCell.FormulaR1C1 = "y2"
Range("AG4").Select
ActiveCell.FormulaR1C1 = "TOT"
Range("AE5").Select
ActiveCell.FormulaR1C1 = "=RC[-24]"
Range("AF5").Select
ActiveCell.FormulaR1C1 = "=RC[-23]"
Range("AG5").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])/730"
Columns("AE:AG").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'-----------------------------------------------------------
'THIS SECTION TAKES THE RESULT GENERATED IN COL AG "TOT" AND PASTES IT INTO THE "DDR" COL T.
'THE NUMBER '13' FOUND WITHIN THE PARENS IS COUNTING NUMBER OF COLUMNS TO THE RIGHT OF "T5" WHICH IS COL 'AG's contents
'THIS code performs the copy paste downward task but
'only to the point where data exists in column A
'THE CODE COPIES THE CONTENTS AND THE FORMATTING FOUND IN T5 DOWNWARD, BUT DON'T WANT IT TO COPY THE COLOR
'OF THAT CELL OR BORDER FORMATTING DOWNWARD
'DO THE CODE LIKE THIS TO AVOID COPYING FORMATTING DOWNWARD/FILLING DOWN
'THE NEW BELOW CODE DOES NOT COPY IT DOWNWARD - ALSO CORRECTED TO BE 14.
Range("T5").FormulaR1C1 = "=RC[14]"
Range("AE5:AG5").AutoFill Destination:=Range("AE5:AG" & Range("A" & Rows.Count).End(xlUp).row), Type:=xlFillDefault
Range("T5").AutoFill Destination:=Range("T5:T" & Range("A" & Rows.Count).End(xlUp).row), Type:=xlFillValues
'-----------------------------------------------------------
'THIS SECTION PUTS IN ALL THE COL HEADERS OF "X THROUGH AD"
Range("X4").Select
ActiveCell.FormulaR1C1 = "NIIN"
Range("Y4").Select
ActiveCell.FormulaR1C1 = "Noun"
Range("Z4").Select
ActiveCell.FormulaR1C1 = "AAC"
Range("AA4").Select
ActiveCell.FormulaR1C1 = "Blank"
Range("AB4").Select
ActiveCell.FormulaR1C1 = "Report NIIN"
Range("AC4").Select
ActiveCell.FormulaR1C1 = "Report Noun"
Range("AD4").Select
ActiveCell.FormulaR1C1 = "Report AAC"
'-----------------------------------------------------------
'Sub mod_39_COPA_add_formulas_x_to_z_MOD_39()
'
' THIS SECTIONS ADDS THE FORMULAS TO X,Y,Z AND pastes and drags downward in x through z
'
'THIS FORMULA WAS ENTERED INTO X5
Range("X5").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-23],5,9)"
'THIS FORMULA WAS ENTERED INTO Y5
Range("Y5").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],C[3]:C[4],2,FALSE)"
'THIS FORMULA WAS ENTERED INTO Z5
Range("Z5").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],C[2]:C[4],3,FALSE)"
' DRAG FORMULAS FROM X TO Z DOWN TO BOTTOM
Range("X5:Z5").Select
Range("X5:Z5").AutoFill Destination:=Range("X5:Z" & Range("A" & Rows.Count).End(xlUp).row), Type:=xlFillDefault
'-----------------------------------------------------------
'THIS SECTION WAS TAKEN FROM MOD 39, SUB MACRO6, IT SIMPLY COPIES "Y" RESULTS TO "O"
'Sub Macro6()
'
' Macro6 Macro
' select all the cells in Y and paste all to O
'
Range("Y5").AutoFill Destination:=Range("Y5:Y" & Range("A" & Rows.Count).End(xlUp).row), Type:=xlFillDefault
Selection.Copy
Range("O5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'-------------------------------------------------------------
'THIS SIMPLY SAVES THE WORKBOOK (don't want it turned on just yet - with test files)
'ActiveWorkbook.Save
'------------------------------------------------------------
'THIS SECTION COPIES THE RESULTS SITTING IN COLUMN X AND PLACES THAT LIST OF DATA ONTO THE CLIPBOARD
'ITS NOW READY TO CLICK PASTE -- ONCE THE USER GETS INTO THEIR EMALL APPLICATION
'Sub CopyToClipboard()
Range("X5:X5000").Copy
'-------------------------------------------------------------
'THIS LAST PIECE POPS UP A MESSAGE TO THE USER TO GUIDE THEM ON WHAT TO DO NEXT USING AN OUTSIDE SYSTEM
'THIS IS A SIMPLE MESSAGE BOX
MsgBox ("Your Column X NIINs have been copied," & vbCrLf & "Please open EMALL and paste into ORDERS > DLA ORDERS," & vbCrLf & "Select NSN/NIIN UPLOAD CAPABILITY, paste & click Submit," & vbCrLf & "Click Export to Excel and open exported file" & vbCrLf & "then copy/paste from export file to your forecasting file" & vbCrLf & "Col B to AB" & vbCrLf & "Col E to AC and" & vbCrLf & "Col N to AD.")
'-------------------------------------------------------------
End If
End Sub