I am looking to combine these macros. I need this macro to scrub through a folder and open up each workbook and update the column headings. The only catch is I need the two different tabs to get different headings. The two sheet names within each workbook are called "CRM" and "Aspirational"
Code:
Sub ProcessFiles() Dim Filename, Pathname As String
Dim wb As Workbook
Pathname = "C:\Users\c755748\Desktop\TEST2\"
Filename = Dir(Pathname & "*.xls")
Do While Filename <> ""
Set wb = Workbooks.Open(Pathname & Filename)
DoWork wb
wb.Close SaveChanges:=True
Filename = Dir()
Loop
End Sub
Code:
Sub DoWork(wb As Workbook) With wb
'Call UpdateHeadersAspirational
'Call CRM
End With
End Sub
Code:
Sub UpdateHeadersAspirational()
[COLOR=#ff0000]With Sheets("Aspirational").Select[/COLOR]
[A1].Formula = "FCAST_BTQ_NM"
[B1].Formula = "EST_MNDT_USD_AMT"
[C1].Formula = "INV_VHCL_NM"
[D1].Formula = "EST_FDNG_QTR_NM"
[E1].Formula = "STAT_UPDT_TXT"
[F1].Formula = "OPTY_NMBR"
[G1].Formula = "CO_NM"
[H1].Formula = "CNSLT_NM"
[I1].Formula = "PRMY_PRDCT_NM"
[J1].Formula = "BTQ_PRMY_PRDCT_TYP_NM"
[K1].Formula = "INV_VHCL_2_NM"
[L1].Formula = "PLNE_STP_NM"
[M1].Formula = "RNKG_TYP_NM"
[N1].Formula = "CRNCY_NM"
[O1].Formula = "EST_MNDT_AMT"
[P1].Formula = "EST_DCSN_DT"
[Q1].Formula = "TM_MBR_NM"
[R1].Formula = "RGN_4_NM"
[S1].Formula = "OPTY_TYP_NM"
[T1].Formula = "MOD_DT"
End With
End Sub
Code:
Sub UpdateHeadersCRM()
[COLOR=#ff0000]With Sheets("CRM").Select[/COLOR]
[A1].Formula = "WGTD_SLS_CAL_AMT"
[B1].Formula = "SLS_ROLE_NM"
[C1].Formula = "INV_VHCL_NM"
[D1].Formula = "EST_FDNG_QTR_NM"
[E1].Formula = "PCT_EST_MNDT"
[F1].Formula = "WT_PRC"
[G1].Formula = "AVG_BPS_AMT"
[H1].Formula = "OPTY_NMBR"
[I1].Formula = "CO_NM"
[J1].Formula = "CNSLT_NM"
[K1].Formula = "PRMY_PRDCT_NM"
[L1].Formula = "BTQ_PRMY_PRDCT_TYP_NM"
[M1].Formula = "INV_VHCL_2_NM"
[N1].Formula = "PLNE_STP_NM"
[O1].Formula = "RNKG_TYP_NM"
[P1].Formula = "CRNCY_NM"
[Q1].Formula = "EST_MNDT_AMT"
[R1].Formula = "EST_MNDT_USD_AMT"
[S1].Formula = "EST_DCSN_DT"
[T1].Formula = "TM_MBR_NM"
[U1].Formula = "RGN_4_NM"
[V1].Formula = "OPTY_TYP_NM"
[W1].Formula = "MOD_DT"
End With
End Sub