Not sure how to convert these actual cell formulas into VBA. This code should insert headers for the columns in Row 4, then insert the formulas into Row 5, and last, drag forumals down as far as there is data present in Col A. (don't want it to drag to bottom of page and have a bunch of errored out cells where data doesnt exist)
Code:
'-----------------------------------------------------------
'THIS IS NEW CODE TO INSERT X THROUGH AC FORMULAS TO ACTIVATE SUMMARY TAB RESULTS
'PUTS IN ALL THE COL HEADERS OF "X THROUGH AC"
Range("X4").Select
ActiveCell.FormulaR1C1 = "NIIN"
Range("Y4").Select
ActiveCell.FormulaR1C1 = "STATUS"
Range("Z4").Select
ActiveCell.FormulaR1C1 = "Y1 DMDS"
Range("AA4").Select
ActiveCell.FormulaR1C1 = "Y2 DMDS"
Range("AB4").Select
ActiveCell.FormulaR1C1 = "TOT"
Range("AC4").Select
ActiveCell.FormulaR1C1 = "NSN"
'-----------------------------------------------------------
'THIS IS NEW CODE TO INSERT X THROUGH AC FORMULAS TO ACTIVATE SUMMARY TAB RESULTS
' INSERTS THE FORMULAS TO X,Y,Z,AA,AB,AC and drags downward WHERE DATA EXISTS IN COL A'
'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:AC5").Select
'Range("X5:AC5").AutoFill Destination:=Range("X5:AC" & Range("A" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
Range("X4").Select
ActiveCell.FormulaR1C1 = "?????"
'>>>>THE ABOVE ACTUAL CELL FORMULA IS: =MID(A5,5,9)
Range("Y4").Select
ActiveCell.FormulaR1C1 = "??????"
'>>>>THE ABOVE ACTUAL CELL FORMULA IS: =COUNTIF(A:A, A5)>1
Range("Z4").Select
ActiveCell.FormulaR1C1 = "??????"
'>>>>THE ABOVE ACTUAL CELL FORMULA IS: =G5
Range("AA4").Select
ActiveCell.FormulaR1C1 = "??????"
'>>>>THE ABOVE ACTUAL CELL FORMULA IS: =I5
Range("AB4").Select
ActiveCell.FormulaR1C1 = "??????"
'>>>>THE ABOVE ACTUAL CELL FORMULA IS: =SUM(Z5+AA5)/730
Range("AC4").Select
ActiveCell.FormulaR1C1 = "??????"
'>>>>THE ABOVE ACTUAL CELL FORMULA IS: =A5)