Sub G_Fieldko_Data_Loader_Sales_Upload()
'
' G_Fieldko_Data_Loader_Sales_Upload Macro
'
'
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[1],'[Fieldko - Budget MTD sales by CG.xlsx]Budget MTD by CG'!C1:C3,3,0)"
Range("D2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[1],'[Fieldko - Budget MTD sales by CG.xlsx]Budget MTD by CG'!C1:C3,3,0),""0"")"
Range("D2").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.AutoFill Destination:=Range("D2:D4700")
Range("D2:D4700").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[Fieldko - Budget MTD sales by CG.xlsx]Budget MTD by CG'!C1:C4,4,0)"
Range("F2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-1],'[Fieldko - Budget MTD sales by CG.xlsx]Budget MTD by CG'!C1:C4,4,0),""0"")"
Range("F2").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.AutoFill Destination:=Range("F2:F4700")
Range("F2:F4700").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=-42
Range("A2").Select
ActiveWindow.FreezePanes = True
Range("G2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=NOW()+1"
Range("G2").Select
Columns("G:G").EntireColumn.AutoFit
Selection.AutoFill Destination:=Range("G2:G4700")
Range("G2:G4700").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("H2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-3],'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,3,0)"
Range("H2").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-3],'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,3,0),""0"")"
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,3,0),""0"")"
Range("H2").Select
Selection.AutoFill Destination:=Range("H2:M2"), Type:=xlFillDefault
Range("H2:M2").Select
Range("I2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,4,0),""0"")"
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,5,0),""0"")"
Range("K2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,6,0),""0"")"
Range("L2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,7,0),""0"")"
Range("M2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko - Monthly Sales by VRG.xlsx]Fieldko Monthly Sales by VRG'!C1:C8,8,0),""0"")"
Range("H2:M2").Select
Selection.AutoFill Destination:=Range("H2:M4700")
Range("H2:M4700").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("N2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-9],'[Fieldko Rolling Monthly Sales.xlsx]Fieldko - Rolling Monthly Sales'!C1:C19,17,0)"
Range("N2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko Rolling Monthly Sales.xlsx]Fieldko - Rolling Monthly Sales'!C1:C19,17,0),""0"")"
Range("N2").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.AutoFill Destination:=Range("N2:Q2"), Type:=xlFillDefault
Range("N2:Q2").Select
Range("O2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko Rolling Monthly Sales.xlsx]Fieldko - Rolling Monthly Sales'!C1:C19,18,0),""0"")"
Range("P2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko Rolling Monthly Sales.xlsx]Fieldko - Rolling Monthly Sales'!C1:C19,19,0),""0"")"
Range("Q2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC5,'[Fieldko Rolling Monthly Sales.xlsx]Fieldko - Rolling Monthly Sales'!C1:C19,16,0),""0"")"
Range("N2:Q2").Select
Selection.AutoFill Destination:=Range("N2:Q4700")
Range("N2:Q4700").Select
Range("N10").Select
Selection.NumberFormat = "0.00000"
Selection.NumberFormat = "0.0000"
Selection.NumberFormat = "0.000"
Selection.NumberFormat = "0.00"
Selection.NumberFormat = "0.0"
Selection.NumberFormat = "0"
Selection.AutoFill Destination:=Range("N10:N4700")
Range("N10:N4700").Select
Range("O10").Select
Selection.NumberFormat = "0.00000"
Selection.NumberFormat = "0.0000"
Selection.NumberFormat = "0.000"
Selection.NumberFormat = "0.00"
Selection.NumberFormat = "0.0"
Selection.NumberFormat = "0"
Selection.AutoFill Destination:=Range("O10:O4700")
Range("O10:O4700").Select
Range("P7").Select
Selection.NumberFormat = "0.00000"
Selection.NumberFormat = "0.0000"
Selection.NumberFormat = "0.000"
Selection.NumberFormat = "0.00"
Selection.NumberFormat = "0.0"
Selection.NumberFormat = "0"
Selection.AutoFill Destination:=Range("P7:P4700")
Range("P7:P4700").Select
Range("N2:Q2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=-27
Application.CutCopyMode = False
Columns("A:A").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Range("A1").Select
ActiveCell.FormulaR1C1 = "ID"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\lmcdonald\Desktop\Fieldko (Data Loader) Sales upload.csv", _
FileFormat:=xlCSV, CreateBackup:=False
End Sub
Bookmarks