Macro VB
Macro VB
Sub Match_ubs()
Sheets("Recon").Select
Range("B4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Sheets("VMAP").Select
Columns("F:F").Cut
Columns("D:D").Insert Shift:=xlToRight
Columns("E:F").EntireColumn.Insert
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("UBS").Select
Range("A1").Select
Columns("A:A").Select
Range("A10").Activate
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(11, 1), Array(39, 1), Array(45, 1), Array(54, 1), _
Array(62, 1), Array(78, 1), Array(87, 1), Array(101, 1), Array(113, 1), Array(118, 1), _
Array(127, 1)), TrailingMinusNumbers:=True
Cells.Select
Cells.EntireColumn.AutoFit
Range("B1").EntireColumn.Insert
Range("A:A").Copy
Range("B1").Select
ActiveSheet.Paste
Range("B:B").Select
Selection.Replace What:="-----------", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1").Select
Dim wks As Worksheet
Dim rng As Range
Dim LastRow As Long
Dim col As Long
Columns("C:C").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Columns("B:B").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=USD Cash", _
Operator:=xlAnd
ActiveCell.Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=+RC[6]"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter
Sheets("Recon").Select
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-5],UBS!C2:C4,1,0)"
Range("H4").FormulaR1C1 = "=VLOOKUP(RC[-6],UBS!C2:C4,3,0)"
Range("I4").FormulaR1C1 = "=VLOOKUP(RC[-7],UBS!C2:C4,2,0)"
Range("G4:I4").Select
Selection.Copy
Range("d4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("K4").Select
Range("K4").FormulaR1C1 = "=+RC[-7]-RC[-2]"
Selection.Copy
Range("I4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("G:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
Sub Match_MS()
Sheets("Recon").Select
Range("B4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Sheets("VMAP").Select
Columns("F:F").Cut
Columns("D:D").Insert Shift:=xlToRight
Columns("E:F").EntireColumn.Insert
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("MS-MainFrame").Select
Range("A1").Select
Cells.Select
Application.CutCopyMode = False
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("B:B").Select
Cells.Select
Cells.EntireColumn.AutoFit
Columns("B:B").Select
Cells.Replace What:=" ", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Columns("C:C").Select
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("A:A").Select
Selection.Replace What:="AAMT", Replacement:="USD Cash", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("C:C").Select
Selection.Copy
Columns("A:A").Select
ActiveSheet.Paste
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=USD Cash", _
Operator:=xlAnd
ActiveCell.Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=+RC[3]"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Sheets("Recon").Select
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-5],MS-MainFrame!C1:C4,1,0)"
Range("H4").FormulaR1C1 = "=VLOOKUP(RC[-6],MS-MainFrame!C1:C4,4,0)"
Range("I4").FormulaR1C1 = "=VLOOKUP(RC[-7],MS-MainFrame!C1:C4,2,0)"
Range("G4:I4").Select
Selection.Copy
Range("d4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("K4").Select
Range("K4").FormulaR1C1 = "=+RC[-7]-RC[-2]"
Selection.Copy
Range("I4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("G:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
Sub Match_MS2()
Sheets("Recon").Select
Range("B4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Sheets("VMAP").Select
Columns("F:F").Cut
Columns("D:D").Insert Shift:=xlToRight
Columns("E:F").EntireColumn.Insert
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("MS-CGTrade").Select
Range("a1").Select
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
Range("1:1").Insert
Columns("F:F").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=Position" _
, Operator:=xlOr, Criteria2:="="
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
Range("G1").EntireColumn.Insert
Range("G1").EntireColumn.Insert
Range("H1").FormulaR1C1 = "=VLOOKUP(RC[-6],Recon!R4C2:R500C2,1,0)"
Range("H1").Select
Selection.Copy
Range("F1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("H:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("1:1").Insert
Range("H1").FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-5],'MS-CGTrade'!C2:C6,1,0)"
Range("H4").FormulaR1C1 = "=VLOOKUP(RC[-6],'MS-CGTrade'!C2:C6,2,0)"
Range("I4").FormulaR1C1 = "=VLOOKUP(RC[-7],'MS-CGTrade'!C2:C6,5,0)"
Range("G4:I4").Select
Selection.Copy
Range("d4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("G:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("MS-CGTrade").Select
Columns("D:E").Delete
Columns("F:F").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
ActiveCell.Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("G65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Range("K4").Select
Range("K4").FormulaR1C1 = "=+RC[-7]-RC[-2]"
Selection.Copy
Range("I4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
Sub HoldingMatch()
Sheets("RECON").Select
Range("A4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Range("A4").Select
Sheets("MSB").Select
Range("A1").Select
Range("M1").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-12])"
Range("N1").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-12])"
Range("M1:N1").Select
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(1, 12).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("M:N").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Replace What:="RDS'B", Replacement:="RDS B", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Columns("D:E").Select
Selection.Delete Shift:=xlToLeft
Columns("K:L").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 3).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'=======================================================================
Sheets("VestMark").Select
Range("A1").Select
Columns("F:F").Select
Selection.Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Columns("E:F").Select
Selection.EntireColumn.Insert
Range("E3").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Recon!R4C2:R1500C4,1,0)"
Selection.Copy
Range("B2").Select
Selection.End(xlDown).Select
Selection.Offset(0, 3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("e4").Select
Selection.EntireColumn.Insert
'=======================================================================
Sheets("Custodian").Select
Range("A1").Select
Columns("B:B").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=Kinkaid School Ret Plan-Invesco", Operator:=xlOr, Criteria2:="="
Cells.Select
Selection.Delete Shift:=xlUp
Columns("A:A").Select
Selection.Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Columns("D:E").Select
Selection.EntireColumn.Insert
Range("E3").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Cells.Replace What:="BDAXX ", Replacement:="USD CASH", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Range("E:E").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("D4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Recon!R4C2:R1500C4,1,0)"
Selection.Copy
Range("B2").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("e4").Select
Selection.EntireColumn.Insert
Range("D4").Select
Selection.EntireColumn.Insert
'=======================================================================
Sheets("Recon").Select
Range("F4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],VestMark!R3C2:R1500C4,1,0)"
Range("G4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],VestMark!R3C2:R1500C4,2,0)"
Range("H4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-6],VestMark!R3C2:R1500C4,3,0)"
Range("F4:H4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("VestMark").Select
Range("B1").FormulaR1C1 = "Data"
Range("D1").FormulaR1C1 = "Data"
Range("F:F").Select
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Else
Selection.End(xlDown).Select
'Selection.End(xlDown).Select
ActiveCell.Offset(2, -4).Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
'Range(Selection, Selection.End(xlToRight)).Select
' Range(Selection, Selection.End(xlDown)).Select
End If
Selection.Copy
Sheets("Recon").Select
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 2).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("J4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-8],Custodian!R4C1:R1500C3,1,0)"
Range("K4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-9],Custodian!R4C1:R1500C3,2,0)"
Range("L4").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-10],Custodian!R4C1:R1500C3,3,0)"
Range("J4:L4").Select
Selection.Copy
Range("H4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Custodian").Select
Range("A1").FormulaR1C1 = "Data"
Range("E:E").Select
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
If ActiveCell = "" Then
Else
Selection.End(xlDown).Select
ActiveCell.Offset(1, -4).Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
' Range(Selection, Selection.End(xlDown)).Select
End If
'Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("H4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 2).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("E4").Select
ActiveCell.FormulaR1C1 = "=+RC[-1]-RC[3]"
Selection.Copy
Range("F4").Select
Selection.End(xlDown).Select
Selection.Offset(1, -1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("I4").Select
ActiveCell.FormulaR1C1 = "=+RC[-1]-RC[3]"
Selection.Copy
Range("H4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("M4").Select
ActiveCell.FormulaR1C1 = "=+RC[-9]-RC[-1]"
Selection.Copy
Range("L4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
4. Model comparison
Sub Ticker_Macro()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
Workbooks.Open Filename:=f
Range("E7").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
Selection.Copy
Range("C7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("I7").Select
ActiveCell.FormulaR1C1 = _
"=IF(LEN(RC[-4])-LEN(SUBSTITUTE(RC[-4],""("",""""))>1,MID(LEFT(RC[-4],LEN(RC[-4])-1),FIND(""("",RC[-
4],FIND(""("",RC[-4])+1)+1,999),MID(LEFT(RC[-4], LEN(RC[-4])-1),FIND(""("",RC[-4])+1,999))"
Selection.Copy
Range("E7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("E:E").Select
Selection.ClearContents
Range("J7").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[-6],2)"
Selection.Copy
Range("I7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "TDAM"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Name = "Recon"
'ActiveWorkbook.Close
Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco
VMAP Models\MODIEF.csv"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("TDAM").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],AIIG!C[-7],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
' ChDir _
' "S:\APAM\OPERATIONS\Model Comparison\IEF"
' Workbooks.OpenText Filename:= _
' "S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
' xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
' Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
' Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
' Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
', 1)), TrailingMinusNumbers:=True
'Cells.Select
'Selection.Copy
' wb1.Activate
'Sheets("TDAM").Select
'ActiveSheet.Paste
'Columns("A:B").Select
'Selection.Delete Shift:=xlToLeft
'Columns("C:E").Select
'Selection.Delete Shift:=xlToLeft
'Columns("D").Select
'Selection.Delete Shift:=xlToLeft
'Columns("E:H").Select
'Selection.Delete Shift:=xlToLeft
' Columns("I:I").Select
' Selection.Replace What:="100", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Columns("D:D").Select
' Selection.Replace What:="#VALUE!", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("E:E").Select
'Selection.Clear
'Range("A1").Select
'Selection.EntireRow.Delete
'Trim function for Ticks to use in model comparison spreadsheets.
'Range("E1").Select
' ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
' LR = Range("C" & Rows.Count).End(xlUp).Row
' Range("E1").AutoFill Destination:=Range("E1:E" & LR)
' Range("E1:E" & LR).Select
'Selection.Copy
'Range("A1").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Range("E:E").Select
'Selection.Clear
'Columns("D:D").Select
'Selection.NumberFormat = "0.00"
'Columns("A:A").Select
'Selection.Replace What:="CASH", Replacement:="Working Capital ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A:E").Select
'Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Rows("1:2").Select
'Selection.Delete Shift:=xlUp
'Range("A1").Select
'Range("A1").Select
'Columns("D:D").Select
'Selection.Cut
'Columns("C:C").Select
'Selection.Insert Shift:=xlToRight
Sheets("AIIG").Select
Range("I7").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Sort Key1:=Range("I7"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Selection.Copy
Sheets("Recon").Select
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F4").Select
Range("F4").FormulaR1C1 = "=VLOOKUP(RC[-3],TDAM!R1C1:R10700C3,1,0)"
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-4],TDAM!R1C1:R700C3,2,0)"
Range("F4:g4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("tdam").Select
' Range("F1").Select
'ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Recon!R4C3:R1500C3,1,0)"
'Range("F1").Select
'Selection.Copy
'Range("D1").Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 2).Select
'Range(Selection, Selection.End(xlUp)).Select
'ActiveSheet.Paste
'Application.CutCopyMode = False
' Selection.Copy
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Application.CutCopyMode = False
'Rows("1:1").Select
'Selection.EntireRow.Insert
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
' Columns("B:B").Delete
' Columns("C:C").Delete
' Range("D1").Select
ActiveCell.Activate
Range("A65536").End(xlUp).Offset(1, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
' Selection.End(xlDown).Select
' Selection.Offset(0, -5).Select
' Range(Selection, Selection.End(xlDown)).Select
' Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("recon").Select
'ActiveSheet.Next.Select
Range("F4").Select
Range("F65536").End(xlUp).Offset(1, 0).Select
'Selection.End(xlDown).Select
'Selection.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
'ActiveCell.Offset(0, 1).Select
' Selection.Delete Shift:=xlToLeft
'ActiveCell.Offset(0, 1).Select
' Selection.Delete Shift:=xlToLeft
Range("E4").Select
ActiveCell.FormulaR1C1 = "=+RC[-1]-RC[2]"
Range("E4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(3, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("E:E").EntireColumn.AutoFit
Range("C2").FormulaR1C1 = "TDAM"
Range("C3").FormulaR1C1 = "Ticker"
Range("D3").FormulaR1C1 = "%of"
Range("F2").FormulaR1C1 = "Invesco"
Range("F3").FormulaR1C1 = "Ticker"
Range("G3").FormulaR1C1 = "%of"
Range("E3").FormulaR1C1 = "Diffrence"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Cells.Select
Cells.EntireColumn.AutoFit
With Selection.Font
.Name = "Arial"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("C2:G3").Select
Selection.Font.Bold = True
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Sheets("TDAM").Name = "Invesco"
Sheets("AIIG").Name = "TDAM"
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
Sheets("recon").Select
Columns("E:E").ColumnWidth = 24.57
Columns("D:D").ColumnWidth = 8.71
Columns("G:G").ColumnWidth = 8.29
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Columns("E:E").Select
Selection.NumberFormat = "0.00"
End Sub
Sub PrudentialIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:16").Select
Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-4],""%"","""""""")*100"
Selection.Copy
Range("B1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("B:B").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:D1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Hoja3").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Hoja1").Select
Sheets("Hoja1").Name = "Pru"
Sheets("Hoja2").Select
Sheets("Hoja2").Name = "IEF"
Sheets("Hoja3").Select
Sheets("Hoja3").Name = "Recon"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("IEF").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Pru!C[-14],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-6],IEF!C1:C4,1,0)"
Range("I3").FormulaR1C1 = "=VLOOKUP(RC[-7],IEF!C1:C4,2,0)"
Range("H3:I3").Select
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("IEF").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("D65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Port %"
Range("F3").FormulaR1C1 = "Difference"
Range("H3").FormulaR1C1 = "Invesco_Ticker"
Range("I3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "PRUDENTIAL"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("H:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("J3").FormulaR1C1 = "COMMENTS"
Columns("J:J").ColumnWidth = 30
Range("J:J").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(J1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=SUM(RC[-2]-RC[3])"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range("A65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.NumberFormat = "0.00"
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
Sub EnvestnetIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Envestnet"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Envestnet").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "Envestnet"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
Sub MSDWIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "MSDW"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("MSDW").Select
Range("A:A").Select
Selection.Replace What:="$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "MSDW"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "Placemark"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(1, 1).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(3, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=SUM(RC[-2]-RC[3])"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODMCE.csv").Activate
ActiveWorkbook.Close
End Sub
Sub MSDWMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "MSDW"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("MSDW").Select
Range("A:A").Select
Selection.Replace What:="$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model
Comparisons\Invesco VMAP Models\MODMCE.csv"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(1, 1).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(3, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "MSDW"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODMCE.csv").Activate
ActiveWorkbook.Close
End Sub
Sub StifelMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
'Rows("1:9").Select
' Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Stifel"
Range("R2").Select
Range("R2").FormulaR1C1 = "=SUBSTITUTE(RC[-10],""%"","""""""")"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[15],2)"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Columns("R:R").Cut
' Columns("C:C").Select
'Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Stifel").Select
Range("A:A").Select
'Selection.Replace What:="$$$$", Replacement:="USD Cash", LookAt:=xlPart, _
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False
'Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("C1").Select
Range("C1").FormulaR1C1 = "Weight"
'Dim rngName As Range
ActiveCell.Offset(0, -2).Select
ActiveCell.FormulaR1C1 = "USD Cash"
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A:A").Select
Selection.Replace What:="CASH-1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A:A").Select
' Selection.Replace What:="USDCASH", Replacement:="CASH-1", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
' Range(Selection, Selection.End(xlToLeft)).Select
Selection.EntireRow.Delete
Selection.AutoFilter
Range("C1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(6, 1).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(3, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Selection.Copy
Range("g65536").End(xlUp).Offset(0, -2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C2").FormulaR1C1 = "Stifel"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODMCE.csv").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkINTL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "Placemark"
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("1:1").Insert
Range("C1").FormulaR1C1 = "Percent"
Range("A1").FormulaR1C1 = "Ticker"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODINT.csv").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkGLO()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "Placemark"
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("1:1").Insert
Range("C1").FormulaR1C1 = "Percent"
Range("A1").FormulaR1C1 = "Ticker"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODGLO.csv").Activate
ActiveWorkbook.Close
End Sub
Sub EnvestnetVAL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "Envestnet"
Cells.Select
Cells.EntireColumn.AutoFit
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Envestnet").Select
Range("B1").FormulaR1C1 = "Dynamic Target"
Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
Range("A1").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "Envestnet"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODVAL.csv").Activate
ActiveWorkbook.Close
End Sub
Sub MSDWVAL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Dim wb1 As Workbook
Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
ActiveSheet.Name = "MSDW"
Cells.Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("MSDW").Select
Range("A:A").Select
Selection.Replace What:="$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("a3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "MSDW"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODVAL.csv").Activate
ActiveWorkbook.Close
End Sub
Sub FIDELITYDIV()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "FIDELITY"
Range("N2").Select
Range("N2").FormulaR1C1 = "=Fixed(RC[-6],2)"
Selection.Copy
Range("H65536").End(xlUp).Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("H2").Select
ActiveSheet.Paste
Selection.TextToColumns Destination:=Range("H2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("H:H").Cut
Columns("D:d").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("FIDELITY").Select
'Range("B1").FormulaR1C1 = "Dynamic Target"
Range("A1:D1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("I3").Select
Range("I3").FormulaR1C1 = "=+RC[-5]-RC[-2]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("I3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "FIDELITY"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("i:i").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("J3").FormulaR1C1 = "COMMENTS"
Columns("J:J").ColumnWidth = 30
Range("J:J").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(J1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODDIV.csv").Activate
ActiveWorkbook.Close
End Sub
Sub CitiPrivateIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("1:1").Insert
Range("R2").Select
Range("R2").FormulaR1C1 = "=SUBSTITUTE(RC[-7],""%"","""""""")*100"
Selection.Copy
Range("K2").Select
Range("K65536").End(xlUp).Offset(0, 7).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:D").Insert
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[17],2)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("CitiPrivate").Select
Range("A:A").Select
Selection.Replace What:="$$$$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Range("C2").Select
Range("C2").FormulaR1C1 = "Weight"
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
'Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range("A65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("h65536").End(xlUp).Offset(0, -3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A2").FormulaR1C1 = "CitiPrivate"
Range("A2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
Sub WELLMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:9").Select
Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Wells"
Range("1:1").Insert
Range("S2").Select
Range("S2").FormulaR1C1 = "=SUBSTITUTE(RC[-7],""%"","""""""")*100"
Selection.Copy
Range("S2").Select
Range("L65536").End(xlUp).Offset(0, 7).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:D").Insert
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[18],2)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Wells").Select
Range("A:A").Select
Selection.Replace What:="$$$$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Range("C2").Select
Range("C2").FormulaR1C1 = "Weight"
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
'Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("h65536").End(xlUp).Offset(0, -3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A2").FormulaR1C1 = "Wells"
Range("A2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODMCE.csv").Activate
ActiveWorkbook.Close
End Sub
Sub WELLINTL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:9").Select
Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Wells"
Range("1:1").Insert
Range("S2").Select
Range("S2").FormulaR1C1 = "=SUBSTITUTE(RC[-7],""%"","""""""")*100"
Selection.Copy
Range("S2").Select
Range("L65536").End(xlUp).Offset(0, 7).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:D").Insert
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[18],2)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Wells").Select
Range("A:A").Select
Selection.Replace What:="$$$$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Range("C2").Select
Range("C2").FormulaR1C1 = "Weight"
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
'Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model
Comparisons\Invesco VMAP Models\MODInt.csv"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("h65536").End(xlUp).Offset(0, -3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A2").FormulaR1C1 = "Wells"
Range("A2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODInt.csv").Activate
ActiveWorkbook.Close
End Sub
Sub WELLGLO()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("1:1").Insert
Range("S2").Select
Range("S2").FormulaR1C1 = "=SUBSTITUTE(RC[-7],""%"","""""""")*100"
Selection.Copy
Range("S2").Select
Range("L65536").End(xlUp).Offset(0, 7).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:D").Insert
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[18],2)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Wells").Select
Range("A:A").Select
Selection.Replace What:="$$$$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Range("C2").Select
Range("C2").FormulaR1C1 = "Weight"
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
'Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("H65536").End(xlUp).Offset(0, -3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A2").FormulaR1C1 = "Wells"
Range("A2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODGLO.csv").Activate
ActiveWorkbook.Close
End Sub
Sub CitiPrivateVAL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:8").Select
Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "CitiPrivate"
Range("1:1").Insert
Range("R2").Select
Range("R2").FormulaR1C1 = "=SUBSTITUTE(RC[-7],""%"","""""""")*100"
Selection.Copy
Range("K2").Select
Range("K65536").End(xlUp).Offset(0, 7).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:D").Insert
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[17],2)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("CitiPrivate").Select
Range("A:A").Select
Selection.Replace What:="$$$$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Range("C2").Select
Range("C2").FormulaR1C1 = "Weight"
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
'Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("h65536").End(xlUp).Offset(0, -3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
' Range("D3").FormulaR1C1 = "Port %"
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("A2").FormulaR1C1 = "CitiPrivate"
Range("A2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODVAL.csv").Activate
ActiveWorkbook.Close
End Sub
Sub ENVINTL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "ENVINTL"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("ENVINTL").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range("A65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODINT.csv").Activate
ActiveWorkbook.Close
End Sub
Sub ENVGLO()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "ENVGLO"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("ENVGLO").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODGLO.csv").Activate
ActiveWorkbook.Close
End Sub
Sub ENVMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "ENVMCE"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("ENVMCE").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("a3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "ENVMCE"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODMCE.csv").Activate
ActiveWorkbook.Close
End Sub
Sub ENVLCC()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "ENVLCC"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("ENVLCC").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("a3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "ENVLCC"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODLCC.csv").Activate
ActiveWorkbook.Close
End Sub
'************************
Sub FDX_IEF_Macro()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
Workbooks.Open Filename:=f
Range("E7").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
Selection.Copy
Range("C7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("I7").Select
ActiveCell.FormulaR1C1 = _
"=IF(LEN(RC[-4])-LEN(SUBSTITUTE(RC[-4],""("",""""))>1,MID(LEFT(RC[-4],LEN(RC[-4])-1),FIND(""("",RC[-
4],FIND(""("",RC[-4])+1)+1,999),MID(LEFT(RC[-4], LEN(RC[-4])-1),FIND(""("",RC[-4])+1,999))"
Selection.Copy
Range("E7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("E:E").Select
Selection.ClearContents
Range("J7").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[-6],2)"
Selection.Copy
Range("I7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "TDAM"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Name = "Recon"
'ActiveWorkbook.Close
Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco
VMAP Models\MODIEF.csv"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("TDAM").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],AIIG!C[-7],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
' ChDir _
' "S:\APAM\OPERATIONS\Model Comparison\IEF"
' Workbooks.OpenText Filename:= _
' "S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
' xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
' Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
' Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
' Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
', 1)), TrailingMinusNumbers:=True
'Cells.Select
'Selection.Copy
' wb1.Activate
'Sheets("TDAM").Select
'ActiveSheet.Paste
'Columns("A:B").Select
'Selection.Delete Shift:=xlToLeft
'Columns("C:E").Select
'Selection.Delete Shift:=xlToLeft
'Columns("D").Select
'Selection.Delete Shift:=xlToLeft
'Columns("E:H").Select
'Selection.Delete Shift:=xlToLeft
' Columns("I:I").Select
' Selection.Replace What:="100", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Columns("D:D").Select
' Selection.Replace What:="#VALUE!", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("E:E").Select
'Selection.Clear
'Range("A1").Select
'Selection.EntireRow.Delete
'Trim function for Ticks to use in model comparison spreadsheets.
'Range("E1").Select
' ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
' LR = Range("C" & Rows.Count).End(xlUp).Row
' Range("E1").AutoFill Destination:=Range("E1:E" & LR)
' Range("E1:E" & LR).Select
'Selection.Copy
'Range("A1").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Range("E:E").Select
'Selection.Clear
'Columns("D:D").Select
'Selection.NumberFormat = "0.00"
'Columns("A:A").Select
'Selection.Replace What:="CASH", Replacement:="Working Capital ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A:E").Select
'Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Rows("1:2").Select
'Selection.Delete Shift:=xlUp
'Range("A1").Select
'Range("A1").Select
'Columns("D:D").Select
'Selection.Cut
'Columns("C:C").Select
'Selection.Insert Shift:=xlToRight
Sheets("AIIG").Select
Range("I7").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Sort Key1:=Range("I7"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Selection.Copy
Sheets("Recon").Select
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F4").Select
Range("F4").FormulaR1C1 = "=VLOOKUP(RC[-3],TDAM!R1C1:R10700C3,1,0)"
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-4],TDAM!R1C1:R700C3,2,0)"
Range("F4:g4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("tdam").Select
' Range("F1").Select
'ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Recon!R4C3:R1500C3,1,0)"
'Range("F1").Select
'Selection.Copy
'Range("D1").Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 2).Select
'Range(Selection, Selection.End(xlUp)).Select
'ActiveSheet.Paste
'Application.CutCopyMode = False
' Selection.Copy
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Application.CutCopyMode = False
'Rows("1:1").Select
'Selection.EntireRow.Insert
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
' Columns("B:B").Delete
' Columns("C:C").Delete
' Range("D1").Select
ActiveCell.Activate
Range("A65536").End(xlUp).Offset(1, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
' Selection.End(xlDown).Select
' Selection.Offset(0, -5).Select
' Range(Selection, Selection.End(xlDown)).Select
' Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("recon").Select
'ActiveSheet.Next.Select
Range("F4").Select
Range("F65536").End(xlUp).Offset(1, 0).Select
'Selection.End(xlDown).Select
'Selection.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
'ActiveCell.Offset(0, 1).Select
' Selection.Delete Shift:=xlToLeft
'ActiveCell.Offset(0, 1).Select
' Selection.Delete Shift:=xlToLeft
Range("E4").Select
ActiveCell.FormulaR1C1 = "=+RC[-1]-RC[2]"
Range("E4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(3, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("E:E").EntireColumn.AutoFit
Range("C2").FormulaR1C1 = "TDAM"
Range("C3").FormulaR1C1 = "Ticker"
Range("D3").FormulaR1C1 = "%of"
Range("F2").FormulaR1C1 = "Invesco"
Range("F3").FormulaR1C1 = "Ticker"
Range("G3").FormulaR1C1 = "%of"
Range("E3").FormulaR1C1 = "Diffrence"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Cells.Select
Cells.EntireColumn.AutoFit
With Selection.Font
.Name = "Arial"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("C2:G3").Select
Selection.Font.Bold = True
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Sheets("TDAM").Name = "Invesco"
Sheets("AIIG").Name = "TDAM"
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
Sheets("recon").Select
Columns("E:E").ColumnWidth = 24.57
Columns("D:D").ColumnWidth = 8.71
Columns("G:G").ColumnWidth = 8.29
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Columns("E:E").Select
Selection.NumberFormat = "0.00"
End Sub
'**************************************************
Sub IFDXIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
LastRow = Range("c3").End(xlDown).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Delete Shift:=xlUp
Range("A1:A2").Select
'Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("C1:C2").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("B1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("D1:E1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Columns("a:f").Select
Selection.Copy
Columns("h:n").Select
Columns("a:f").Select
Selection.Delete Shift:=xlToLeft
Columns("b:b").Select
Selection.Copy
Columns("M:M").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("M1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Columns("N:O").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("A1").Select
Range("H1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]="""",RC[-7],RC[-6])"
Range("H1").Select
Selection.Copy
Range("A65536").End(xlUp).Offset(0, 7).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Columns("B:B").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("J1").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-8])"
'Range("J1").Select
Selection.Copy
Range("a65536").End(xlUp).Offset(0, 9).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Columns("J:J").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("c:c").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-5],""%"","""""""")"
Selection.Copy
Range("B1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("B:B").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:d1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Hoja3").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Hoja1").Select
Sheets("Hoja1").Name = "Pru"
Sheets("Hoja2").Select
Sheets("Hoja2").Name = "IEF"
Sheets("Hoja3").Select
Sheets("Hoja3").Name = "Recon"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("IEF").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Pru!C[-14],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("g:g").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-6],IEF!C1:C4,1,0)"
Range("I3").FormulaR1C1 = "=VLOOKUP(RC[-7],IEF!C1:C4,2,0)"
Range("H3:I3").Select
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("IEF").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("D65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Share Qty"
Range("F3").FormulaR1C1 = "Difference"
Range("H3").FormulaR1C1 = "Invesco_Ticker"
Range("I3").FormulaR1C1 = "Shares Qty"
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("H65536").End(xlUp).Offset(0, -2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("B2").FormulaR1C1 = "PRUDENTIAL"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("H:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("J3").FormulaR1C1 = "COMMENTS"
Columns("J:J").ColumnWidth = 30
Range("J:J").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(J1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODFDI.csv").Activate
ActiveWorkbook.Close
End Sub
'**************************************************
Sub IEFIFDXIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
LastRow = Range("c3").End(xlDown).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Delete Shift:=xlUp
Range("A1:A2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("C1:C2").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("B1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("D1:E1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Columns("a:f").Select
Selection.Copy
Columns("h:n").Select
Columns("a:f").Select
Selection.Delete Shift:=xlToLeft
Columns("b:b").Select
Selection.Copy
Columns("M:M").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("M1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Columns("N:O").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("A1").Select
Range("H1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]="""",RC[-7],RC[-6])"
Range("H1").Select
Selection.Copy
Range("A65536").End(xlUp).Offset(0, 7).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Columns("B:B").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("J1").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-8])"
'Range("J1").Select
Selection.Copy
Range("a65536").End(xlUp).Offset(0, 9).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Columns("J:J").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("c:c").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-5],""%"","""""""")"
Selection.Copy
Range("B1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("B:B").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:d1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Hoja3").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Hoja1").Select
Sheets("Hoja1").Name = "Pru"
Sheets("Hoja2").Select
Sheets("Hoja2").Name = "IEF"
Sheets("Hoja3").Select
Sheets("Hoja3").Name = "Recon"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("IEF").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Pru!C[-14],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-6],IEF!C1:C4,1,0)"
Range("I3").FormulaR1C1 = "=VLOOKUP(RC[-7],IEF!C1:C4,2,0)"
Range("H3:I3").Select
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("IEF").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("D65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Share Qty"
Range("F3").FormulaR1C1 = "Difference"
Range("H3").FormulaR1C1 = "Invesco_Ticker"
Range("I3").FormulaR1C1 = "Share Qty"
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("H65536").End(xlUp).Offset(0, -2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("B2").FormulaR1C1 = "PRUDENTIAL"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("H:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("J3").FormulaR1C1 = "COMMENTS"
Columns("J:J").ColumnWidth = 30
Range("J:J").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(J1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Sub IEFMODIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
'Rows("1:9").Select
' Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Stifel"
'111111111111111111111
Columns("F:F").Select
Selection.Copy
Columns("L:L").Select
ActiveSheet.Paste
Range("B1").Select
Cells.Find(What:="weigh", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.End(xlToLeft).Select
Range("F1").Select
ActiveSheet.Paste
'1111111111
Range("R2").Select
Range("R2").FormulaR1C1 = "=SUBSTITUTE(RC[-12],""%"","""""""")"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:C").Select
Selection.Copy
Range("b:b").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[15],2)"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Columns("R:R").Cut
' Columns("C:C").Select
'Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Stifel").Select
Range("A:A").Select
'Selection.Replace What:="$$$$", Replacement:="USD Cash", LookAt:=xlPart, _
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False
'Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("C1").Select
Range("C1").FormulaR1C1 = "Weight"
'Dim rngName As Range
ActiveCell.Offset(0, -2).Select
' ActiveCell.FormulaR1C1 = "USD Cash"
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A:A").Select
Selection.Replace What:="CASH-1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A:A").Select
' Selection.Replace What:="USDCASH", Replacement:="CASH-1", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
' Range(Selection, Selection.End(xlToLeft)).Select
Selection.EntireRow.Delete
Selection.AutoFilter
Range("C1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(6, 1).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(3, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Selection.Copy
Range("g65536").End(xlUp).Offset(0, -2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C2").FormulaR1C1 = "Stifel"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
'********************************************************************************************
'************************************************************************************************
*
Sub MODMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
'Rows("1:9").Select
' Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Stifel"
Columns("F:F").Select
Selection.Copy
Columns("L:L").Select
ActiveSheet.Paste
Range("B1").Select
Cells.Find(What:="weigh", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.End(xlToLeft).Select
Range("F1").Select
ActiveSheet.Paste
Range("R2").Select
Range("R2").FormulaR1C1 = "=SUBSTITUTE(RC[-12],""%"","""""""")"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C:C").Select
Selection.Copy
Range("b:b").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[15],2)"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Columns("R:R").Cut
' Columns("C:C").Select
'Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Stifel").Select
Range("A:A").Select
'Selection.Replace What:="$$$$", Replacement:="USD Cash", LookAt:=xlPart, _
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False
'Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("C1").Select
Range("C1").FormulaR1C1 = "Weight"
'Dim rngName As Range
ActiveCell.Offset(0, -2).Select
' ActiveCell.FormulaR1C1 = "USD Cash"
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A:A").Select
Selection.Replace What:="CASH-1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A:A").Select
' Selection.Replace What:="USDCASH", Replacement:="CASH-1", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
' Range(Selection, Selection.End(xlToLeft)).Select
Selection.EntireRow.Delete
Selection.AutoFilter
Range("C1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(6, 1).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(3, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Selection.Copy
Range("g65536").End(xlUp).Offset(0, -2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C2").FormulaR1C1 = "Stifel"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODMCE.csv").Activate
ActiveWorkbook.Close
End Sub
'--------------------------------------------------------------------------------------------
Sub MODVAL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
LastRow = Range("c3").End(xlDown).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Delete Shift:=xlUp
Range("A1:A2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("C1:C2").Select
'Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Range("B1").Select
'Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("D1:E1").Select
'Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Columns("a:f").Select
Selection.Copy
Columns("h:n").Select
Columns("a:f").Select
Selection.Delete Shift:=xlToLeft
Columns("b:b").Select
Selection.Copy
Columns("M:M").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("M1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Columns("N:O").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("A1").Select
Range("H1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]="""",RC[-7],RC[-6])"
Range("H1").Select
Selection.Copy
Range("A65536").End(xlUp).Offset(0, 7).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Columns("B:B").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("J1").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-8])"
'Range("J1").Select
Selection.Copy
Range("a65536").End(xlUp).Offset(0, 9).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Columns("J:J").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("c:c").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-5],""%"","""""""")"
Selection.Copy
Range("B1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("B:B").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:d1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Hoja3").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Hoja1").Select
Sheets("Hoja1").Name = "Pru"
Sheets("Hoja2").Select
Sheets("Hoja2").Name = "IEF"
Sheets("Hoja3").Select
Sheets("Hoja3").Name = "Recon"
Cells.Select
Selection.Copy
wb1.Activate
Sheets("IEF").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Pru!C[-14],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("g:g").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-6],IEF!C1:C4,1,0)"
Range("I3").FormulaR1C1 = "=VLOOKUP(RC[-7],IEF!C1:C4,2,0)"
Range("H3:I3").Select
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("IEF").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("b3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("D65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Share Qty"
Range("F3").FormulaR1C1 = "Difference"
Range("H3").FormulaR1C1 = "Invesco_Ticker"
Range("I3").FormulaR1C1 = "Share Qty"
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("H65536").End(xlUp).Offset(0, -2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("B2").FormulaR1C1 = "PRUDENTIAL"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("H:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("J3").FormulaR1C1 = "COMMENTS"
Columns("J:J").ColumnWidth = 30
Range("J:J").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(J1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODVAL.csv").Activate
ActiveWorkbook.Close
End Sub
'-------------------------------------------------------------------
Sub Placemarkval()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "Placemark"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A1").Select
Range("A65536").End(xlUp).Offset(1, 1).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(3, 15).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C1:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=SUM(RC[-2]-RC[3])"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("I3").FormulaR1C1 = "COMMENTS"
Columns("I:I").ColumnWidth = 30
Range("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(I1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODVAL.csv").Activate
ActiveWorkbook.Close
End Sub
'***********************************************************
Sub ENVWMSIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Envestnet"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Envestnet").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("B3").Select
Range("B65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "Envestnet"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.15"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODIEF.csv").Activate
ActiveWorkbook.Close
End Sub
APL TO VESTMARK:
MODULE 1:
Sub HoldingMatch()
Sheets("Recon").Select
Range("B4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Sheets("VestMark").Select
Columns("F:F").Cut
Columns("D:D").Insert Shift:=xlToRight
Columns("E:F").EntireColumn.Insert
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sponsor").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(12, 1), Array(58, 1), Array(64, 1), Array(68, 1), _
Array(74, 1), Array(92, 1), Array(102, 1), Array(112, 1), Array(122, 1), Array(134, 1), _
Array(151, 1)), TrailingMinusNumbers:=True
Columns("A:A").Select
Columns("B:B").Select
Selection.AutoFilter Field:=1, Criteria1:="CASH*", _
Operator:=xlAnd
Selection.End(xlDown).Select
Selection.Offset(0, -1).Select
' Range("A13").Select
ActiveCell.FormulaR1C1 = "=+RC[8]"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter
Columns("A:A").Select
Selection.EntireRow.Delete
Columns("G:G").Cut
Columns("A:A").Insert Shift:=xlToRight
Columns("C:C").Cut
Columns("B:B").Insert Shift:=xlToRight
Columns("D:E").EntireColumn.Insert
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
Range("E1").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],Recon!R4C2:R500C2,1,0)"
Selection.Copy
Selection.Offset(0, -2).Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Recon").Select
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-5],Sponsor!R1C1:R500C3,1,0)"
Range("H4").FormulaR1C1 = "=VLOOKUP(RC[-6],Sponsor!R1C1:R500C3,2,0)"
Range("I4").FormulaR1C1 = "=VLOOKUP(RC[-7],Sponsor!R1C1:R500C3,3,0)"
Range("G4:I4").Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("K4").Select
ActiveCell.FormulaR1C1 = "=+RC[-2]-RC[-7]"
Selection.Copy
Range("I4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
Sub APLtoSponsor()
Sheets("Recon").Select
Range("B4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Sheets("Sponsor").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(12, 1), Array(47, 1), Array(58, 1), Array(62, 1), _
Array(68, 1), Array(74, 1), Array(92, 1), Array(102, 1), Array(110, 1), Array(122, 1), _
Array(134, 1), Array(151, 1)), TrailingMinusNumbers:=True
Columns("A:A").Select
' Range("A13").Select
ActiveCell.FormulaR1C1 = "=+RC[9]"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter
Columns("A:A").Select
Selection.EntireRow.Delete
Columns("H:H").Cut
Columns("A:A").Insert Shift:=xlToRight
Columns("C:C").Cut
Columns("B:B").Insert Shift:=xlToRight
Columns("D:E").EntireColumn.Insert
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
'============
Sheets("APL").Select
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">=<>0", _
Operator:=xlAnd
Selection.EntireRow.Delete
Columns("B:B").Select
Selection.AutoFilter Field:=1, Criteria1:="CASH*", _
Operator:=xlAnd
Selection.End(xlDown).Select
Selection.Offset(0, -1).Select
' Range("A13").Select
ActiveCell.FormulaR1C1 = "=+RC[5]"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=-----", _
Operator:=xlOr, Criteria2:="="
Selection.EntireRow.Delete
Cells.Replace What:="RDS--B", Replacement:="RDS B", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Columns("G:G").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Recon").Select
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-5],APL!R1C1:R1500C3,1,0)"
Range("H4").FormulaR1C1 = "=VLOOKUP(RC[-6],APL!R1C1:R1500C3,3,0)"
Range("I4").FormulaR1C1 = "=VLOOKUP(RC[-7],APL!R1C1:R1500C3,2,0)"
Range("G4:I4").Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 3).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("K4").Select
ActiveCell.FormulaR1C1 = "=+RC[-2]-RC[-7]"
Selection.Copy
Range("I4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
Workbooks.Open Filename:=f
Range("E7").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
Selection.Copy
Range("C7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("I7").Select
ActiveCell.FormulaR1C1 = _
"=IF(LEN(RC[-4])-LEN(SUBSTITUTE(RC[-4],""("",""""))>1,MID(LEFT(RC[-4],LEN(RC[-4])-1),FIND(""("",RC[-
4],FIND(""("",RC[-4])+1)+1,999),MID(LEFT(RC[-4], LEN(RC[-4])-1),FIND(""("",RC[-4])+1,999))"
Selection.Copy
Range("E7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("E:E").Select
Selection.ClearContents
Range("J7").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[-6],2)"
Selection.Copy
Range("I7").Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "TDAM"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Name = "Recon"
'ActiveWorkbook.Close
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\IEF"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("TDAM").Select
ActiveSheet.Paste
Columns("A:B").Select
Selection.Delete Shift:=xlToLeft
Columns("C:E").Select
Selection.Delete Shift:=xlToLeft
Columns("D").Select
Selection.Delete Shift:=xlToLeft
Columns("E:H").Select
Selection.Delete Shift:=xlToLeft
Columns("D:D").Select
Selection.Replace What:="100", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("D:D").Select
Selection.Replace What:="#VALUE!", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("E:E").Select
Selection.Clear
Range("A1").Select
Selection.EntireRow.Delete
'Trim function for Ticks to use in model comparison spreadsheets.
Range("E1").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-4])"
LR = Range("C" & Rows.Count).End(xlUp).Row
Range("E1").AutoFill Destination:=Range("E1:E" & LR)
Range("E1:E" & LR).Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E:E").Select
Selection.Clear
Columns("D:D").Select
Selection.NumberFormat = "0.00"
Columns("A:A").Select
Selection.Replace What:="CASH", Replacement:="Working Capital ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A:E").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Rows("1:2").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Range("A1").Select
Columns("D:D").Select
Selection.Cut
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
Sheets("AIIG").Select
Range("I7").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Sort Key1:=Range("I7"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Selection.Copy
Sheets("Recon").Select
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F4").Select
Range("F4").FormulaR1C1 = "=VLOOKUP(RC[-3],TDAM!R1C1:R1070C3,1,0)"
Range("G4").FormulaR1C1 = "=VLOOKUP(RC[-4],TDAM!R1C1:R70C3,3,0)"
Range("F4:g4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("tdam").Select
Range("F1").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Recon!R4C3:R1500C3,1,0)"
Range("F1").Select
Selection.Copy
Range("D1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Rows("1:1").Select
Selection.EntireRow.Insert
Columns("F:F").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
ActiveCell.Activate
Selection.End(xlDown).Select
Selection.Offset(0, -5).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("recon").Select
'ActiveSheet.Next.Select
Range("F4").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.Offset(0, 1).Select
Selection.Delete Shift:=xlToLeft
ActiveCell.Offset(0, 1).Select
Selection.Delete Shift:=xlToLeft
Range("E4").Select
ActiveCell.FormulaR1C1 = "=+RC[-1]-RC[2]"
Range("E4").Select
Selection.Copy
Range("D4").Select
Selection.End(xlDown).Select
Selection.Offset(3, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("E:E").EntireColumn.AutoFit
Range("C2").FormulaR1C1 = "TDAM"
Range("C3").FormulaR1C1 = "Ticker"
Range("D3").FormulaR1C1 = "%of"
Range("F2").FormulaR1C1 = "Invesco"
Range("F3").FormulaR1C1 = "Ticker"
Range("G3").FormulaR1C1 = "%of"
Range("E3").FormulaR1C1 = "Diffrence"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Cells.Select
Cells.EntireColumn.AutoFit
With Selection.Font
.Name = "Arial"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("C2:G3").Select
Selection.Font.Bold = True
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Sheets("TDAM").Name = "Invesco"
Sheets("AIIG").Name = "TDAM"
Windows("MODIEF.TXT").Activate
ActiveWorkbook.Close
Sheets("recon").Select
Columns("E:E").ColumnWidth = 24.57
Columns("D:D").ColumnWidth = 8.71
Columns("G:G").ColumnWidth = 8.29
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
End Sub
Sub PrudentialIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:15").Select
Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-4],""%"","""""""")*100"
Selection.Copy
Range("B1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("B:B").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:D1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Hoja3").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Hoja1").Select
Sheets("Hoja1").Name = "Pru"
Sheets("Hoja2").Select
Sheets("Hoja2").Name = "IEF"
Sheets("Hoja3").Select
Sheets("Hoja3").Name = "Recon"
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\IEF"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("IEF").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-14],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-6],IEF!C3:C4,1,0)"
Range("I3").FormulaR1C1 = "=VLOOKUP(RC[-7],IEF!C3:C4,2,0)"
Range("H3:I3").Select
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("F3").Select
Range("F3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("IEF").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("D65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Port %"
Range("F3").FormulaR1C1 = "Difference"
Range("H3").FormulaR1C1 = "Invesco_Ticker"
Range("I3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "PRUDENTIAL"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("H:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODIEF.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\IEF"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=SUM(RC[-2]-RC[3])"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODIEF.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub EnvestnetIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Dim wb1 As Workbook
Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Envestnet"
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Envestnet").Select
'Sheets("Hoja3").Select
'Range("A3").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\IEF"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C3:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "Envestnet"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODIEF.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub MSDWIEF()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "MSDW"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("MSDW").Select
Range("A:A").Select
Selection.Replace What:="$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\IEF"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\IEF\MODIEF.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "MSDW"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODIEF.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "Placemark"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\MCE"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\MCE\MODMCE.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=SUM(RC[-2]-RC[3])"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODMCE.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub MSDWMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("C1").Select
Selection.EntireColumn.Insert
ActiveSheet.Name = "MSDW"
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("MSDW").Select
Range("A:A").Select
Selection.Replace What:="$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\MCE"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\MCE\MODMCE.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "MSDW"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODMCE.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub StifelMCE()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:10").Select
Selection.Delete Shift:=xlUp
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "Stifel"
Range("R2").Select
Range("R2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 17).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Selection.Copy
'Range("A2").Select
'Selection.End(xlDown).Select
'Range("C54").Select
'Range(Selection, Selection.End(xlUp)).Select
'ActiveSheet.Paste
'Application.CutCopyMode = False
'Selection.Copy
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
' :=False, Transpose:=False
'ActiveSheet.Paste
'Application.CutCopyMode = False
Range("C2").Select
ActiveCell.FormulaR1C1 = "=FIXED(RC[15],2)"
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Columns("R:R").Cut
' Columns("C:C").Select
'Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Stifel").Select
Range("A:A").Select
Selection.Replace What:="$$$$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("C1").Select
Range("C1").FormulaR1C1 = "Weight"
Dim rngName As Range
Range("A65536").End(xlUp).Offset(2, 2).Select
With ActiveCell
ActiveCell.Offset(0, -2).Select
ActiveCell.FormulaR1C1 = "USDCASH"
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A:A").Select
Selection.Replace What:="CASH-1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A:A").Select
Selection.Replace What:="USDCASH", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
' Range(Selection, Selection.End(xlToLeft)).Select
Selection.EntireRow.Delete
Selection.AutoFilter
Range("C1").Select
Range("A65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\MCE"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\MCE\MODmce.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("INVESCO").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
'Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart,
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("iNVESCO").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
'Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
' Range("D3").FormulaR1C1 = "Port %"
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "Stifel"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="#VALUE!", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODMCE.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkINTL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "Placemark"
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\INT"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\INT\MODINT.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODINT.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub PlacemarkGLO()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "Placemark"
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Placemark").Select
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\GLO"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\GLO\MODGLO.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "PLACEMARK"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODGLO.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub EnvestnetVAL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "Envestnet"
Cells.Select
Cells.EntireColumn.AutoFit
Range("H2").Select
Range("H2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("H:H").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("Envestnet").Select
Range("B1").FormulaR1C1 = "Dynamic Target"
Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
'Sheets("Hoja3").Select
'Range("A3").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\VAL"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\VAL\MODVAL.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C3:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2").FormulaR1C1 = "Envestnet"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODVAL.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub MSDWVAL()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
ActiveSheet.Name = "MSDW"
Cells.Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("C1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "=FIXED(RC[1],2)"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C1").FormulaR1C1 = "Percent"
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("MSDW").Select
Range("A:A").Select
Selection.Replace What:="$", Replacement:="CASH-1", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS'B", Replacement:="RDSB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\VAL"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\VAL\MODVAL.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,1,0)"
Range("H3").FormulaR1C1 = "=VLOOKUP(RC[-7],Invesco!C3:C4,2,0)"
Range("G3:H3").Select
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("E3").Select
Range("E3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("C65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "MSDW"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G2").FormulaR1C1 = "Invesco"
Range("G2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("E:E").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("G:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODVAL.TXT").Activate
ActiveWorkbook.Close
End Sub
Sub FIDELITYDIV()
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "FIDELITY"
Range("N2").Select
Range("N2").FormulaR1C1 = "=Fixed(RC[-6],2)"
Selection.Copy
Range("H65536").End(xlUp).Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("H2").Select
ActiveSheet.Paste
Selection.TextToColumns Destination:=Range("H2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("H:H").Cut
Columns("D:d").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("FIDELITY").Select
'Range("B1").FormulaR1C1 = "Dynamic Target"
Range("A1:D1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Recon").Select
Range("A3").Select
ActiveSheet.Paste
'Sheets("Hoja3").Select
'Range("A3").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ChDir _
"S:\APAM\OPERATIONS\Model Comparison\DIV"
Workbooks.OpenText Filename:= _
"S:\APAM\OPERATIONS\Model Comparison\DIV\MODDIV.txt" _
, Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1)), TrailingMinusNumbers:=True
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-13])"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("P:P").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("P:P").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-13],Recon!C[-15],1,0)"
Selection.Copy
Range("C1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 13).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("C:C").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("J:J").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("E1").Select
Selection.EntireColumn.Insert
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C3:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C3:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("I3").Select
Range("I3").FormulaR1C1 = "=+RC[-5]-RC[-2]"
Selection.Copy
Range("D65536").End(xlUp).Offset(0, 5).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("I3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("C2").FormulaR1C1 = "FIDELITY"
Range("C2:D2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("i:i").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Windows("MODDIV.TXT").Activate
ActiveWorkbook.Close
End Sub
IRT PORTIA:
Sub IRTPortia()
'
' IRTPortia Macro
'
'
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
Cells.Select
Selection.Columns.AutoFit
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Replace What:="O", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("D2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("G2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("G2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
ActiveCell.Offset(0, 4).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
ActiveCell.Offset(0, -1).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -5).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -5).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ActiveCell.Offset(0, 2).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -4).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -4).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ActiveCell.Offset(0, 2).Range("A1").Select
ActiveSheet.Paste
Selection.Replace What:="100", Replacement:="SELL", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="1", Replacement:="BUY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Offset(0, -6).Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Cut
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Cells.Select
Selection.Columns.AutoFit
ActiveCell.Offset(1, 0).Range("A1").Select
Windows("IRTPortiaImport.txt").Activate
Range("A1").Select
Windows("IRT Portia Macro.xlsm").Activate
Sheets("WORKINGS").Select
Rows("1:1").Select
Selection.Copy
Windows("IRTPortiaImport.txt").Activate
ActiveSheet.Paste
Windows("IRT Portia Macro.xlsm").Activate
Sheets("MACRO").Select
Range("A1").Select
Application.CutCopyMode = False
Windows("IRTPortiaImport.txt").Activate
Cells.Select
Selection.Columns.AutoFit
Range("A2").Select
End Sub
Dim w1 As Workbook
pathSep = Application.PathSeparator
'MsgBox "Please select the File Path "
f = Application _
.GetOpenFilename("Excel Files (*.*), *.*")
Workbooks.Open Filename:=f
Cells.Select
Cells.EntireColumn.AutoFit
ActiveSheet.Name = "ENVINTL"
Range("I2").Select
Range("I2").FormulaR1C1 = "=SUBSTITUTE(RC[-6],""%"","""""""")*100"
Selection.Copy
Range("C65536").End(xlUp).Offset(0, 6).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("I:I").Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet1").Name = "Invesco"
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Recon"
Sheets("ENVINTL").Select
Cells.Select
Selection.Copy
wb1.Activate
Sheets("Invesco").Select
ActiveSheet.Paste
Range("P1").Select
Range("P1").FormulaR1C1 = "=TRIM(RC[-15])"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("A:A").Insert
Columns("Q:Q").Select
Selection.Copy
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("Q:Q").Select
Selection.ClearContents
Range("P1").Select
Range("P1").FormulaR1C1 = "=VLOOKUP(RC[-15],Recon!C[-15],1,0)"
Selection.Copy
Range("A1").Select
Range("A65536").End(xlUp).Offset(0, 15).Select
'Selection.End(xlDown).Select
'Selection.Offset(0, 15).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Copy
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Range("C1").Select
Selection.EntireColumn.Insert
Range("A1").Select
Range("A65536").End(xlUp).Offset(5, 0).Select
ActiveCell.FormulaR1C1 = "#N/A"
Range("A65536").End(xlUp).Offset(5, 17).Select
ActiveCell.FormulaR1C1 = "#N/A"
Sheets("Recon").Select
Range("F3").FormulaR1C1 = "=VLOOKUP(RC[-5],Invesco!C1:C4,1,0)"
Range("G3").FormulaR1C1 = "=VLOOKUP(RC[-6],Invesco!C1:C4,2,0)"
Range("F3:G3").Select
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 4).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("D3").Select
Range("D3").FormulaR1C1 = "=+RC[-2]-RC[3]"
Selection.Copy
Range("B65536").End(xlUp).Offset(0, 2).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Sheets("Invesco").Select
Columns("R:R").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="#N/A"
Range("A3").Select
Range("A65536").End(xlUp).Offset(0, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Recon").Select
Range("b65536").End(xlUp).Offset(1, 4).Select
ActiveSheet.Paste
Range("D3").FormulaR1C1 = "Difference"
Range("F3").FormulaR1C1 = "Invesco_Ticker"
Range("G3").FormulaR1C1 = "% of Portfolio"
Range("B2:C2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F2").FormulaR1C1 = "Invesco"
Range("F2:G2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Columns("D:D").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=0.10"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=-0.10"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Columns("F:H").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2:I3").Select
Selection.Style = "Good"
Range("h3").FormulaR1C1 = "COMMENTS"
Columns("H:H").ColumnWidth = 30
Range("H:h").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(H1))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Windows("MODABA.csv").Activate
ActiveWorkbook.Close
End Sub
ETF AUTOMATION
MODULE 1:
Application.DisplayAlerts = False
wbsh1.Close
Application.DisplayAlerts = True
Sheets("VMAPInternalHoldings").Select
Range("J2:J" & Range("A" & Rows.Count).End(xlUp).Row) = "=IF(RC[-8]=""MODABA"",RC[-3]/SUMIF(R2C[-
8]:R10000C[-8],""MODABA"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODABC"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODABC"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODABG"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODABG"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODSBA"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODSBA"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODSBC"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODSBC"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODSBG"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODSBG"",R2C[-3]:R10000C[-3]),""n/a"")))))))))))"
Range("K2:K" & Range("A" & Rows.Count).End(xlUp).Row) = "=RC[-8]"
Range("L2:L" & Range("A" & Rows.Count).End(xlUp).Row) = "=IFERROR(VLOOKUP(RC[-11],'PM-Allweight'!R2C[-
11]:R1000C[-5],6,FALSE),0)"
Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row) = "=RC[-1]-RC[-3]"
Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row) = "=IF(RC[-3]=""USD Cash"","""",IF(RC[-
1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL TO ZERO"",(IF(AND(RC[-1]>0,RC[-4]=0),""NEW BUY"",IF(RC[-
1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
Range("J1:N1") = Array("Calculated Weight", "Ticker", "New Pct", "Chg Pct", "B/S")
Sheets("PM-Allweight").Select
[A1].Select
Range("H2:H" & Range("A" & Rows.Count).End(xlUp).Row) = "=IFERROR(VLOOKUP(RC[-
7],VMAPInternalHoldings!c1,1,FALSE),""Missing Sec"")"
' Range("I2:I" & Range("A" & Rows.Count).End(xlUp).Row) = "=IFERROR(VLOOKUP(RC[-
8],VMAPInternalHoldings!R2C[-8]:R1000C[-2],6,FALSE),0)"
' Range("J2:J" & Range("A" & Rows.Count).End(xlUp).Row) = "=RC[-1]-RC[-2]"
' Range("K2:K" & Range("A" & Rows.Count).End(xlUp).Row) = "=IF(RC[-6]=""USD Cash"","""",IF(RC[-
1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL TO ZERO"",(IF(AND(RC[-1]>0,RC[-3]=0),""NEW BUY"",IF(RC[-
1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
' Range("H1:K1") = Array("Calculated Weight", "New Pct", "Chg Pct", "B/S")
' Cells.EntireColumn.AutoFit
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ActiveSheet.UsedRange.Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="Missing Sec"
Selection.AutoFilter Field:=6, Criteria1:="<>0"
Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("A" & Rows.Count).End(xlUp)(2)
Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("B" & Rows.Count).End(xlUp)(2)
Range("E2:E" & Range("C" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("C" & Rows.Count).End(xlUp)(2)
Range("E2:E" & Range("C" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("K" & Rows.Count).End(xlUp)(2)
Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("L" & Rows.Count).End(xlUp)(2)
Sheets("VMAPInternalHoldings").Range("M2:M" & Sheets("VMAPInternalHoldings").Range("A" &
Rows.Count).End(xlUp).Row) = "=RC[-1]-RC[-3]"
Sheets("VMAPInternalHoldings").Range("N2:N" & Sheets("VMAPInternalHoldings").Range("A" &
Rows.Count).End(xlUp).Row) = "=IF(RC[-3]=""USD Cash"","""",IF(RC[-1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL
TO ZERO"",(IF(AND(RC[-1]>0,RC[-4]=0),""NEW BUY"",IF(RC[-1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
Cells.AutoFilter
Columns("H").Clear
Sheets("VMAPInternalHoldings").Select
CoditionalFormattting
Cells.EntireColumn.AutoFit
ActiveSheet.UsedRange.Borders.LineStyle = xlContinuous
Application.DisplayAlerts = False
Columns("L:M").NumberFormat = "0.00%"
[A1].Select
Cells.HorizontalAlignment = xlLeft
Columns("N:N").Select
Selection.Cut
Columns("L:L").Select
Selection.Insert Shift:=xlToRight
Range("L1").Select
ActiveWorkbook.SaveAs Filename:=mypath + "ETF Recon-Output.xls", FileFormat:=xlExcel8
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "File saved in given Path...!"
End Sub
Function CoditionalFormattting()
End Function
MODULE 2:
'"=IF(RC[-6]=""MODABA"",RC[-2]/SUMIF(R2C[-6]:R10000C[-6],""MODABA"",R2C[-2]:R10000C[-2]),(IF(RC[-
6]=""MODABC"",RC[-2]/SUMIF(R2C[-6]:R10000C[-6],""MODABC"",R2C[-2]:R10000C[-2]),(IF(RC[-
6]=""MODABG"",RC[-2]/SUMIF(R2C[-6]:R10000C[-6],""MODABG"",R2C[-2]:R10000C[-2]),(IF(RC[-
6]=""MODSBA"",RC[-2]/SUMIF(R2C[-6]:R10000C[-6],""MODSBA"",R2C[-2]:R10000C[-2]),(IF(RC[-
6]=""MODSBC"",RC[-2]/SUMIF(R2C[-6]:R10000C[-6],""MODSBC"",R2C[-2]:R10000C[-2]),(IF(RC[-
6]=""MODSBG"",RC[-2]/SUMIF(R2C[-6]:R10000C[-6],""MODSBG"",R2C[-2]:R10000C[-2]),""n/a"")))))))))))"
'"=IFERROR(VLOOKUP(RC[-8],VMAPInternalHoldings!R2C[-8]:R1000C[-2],6,FALSE),0)"
'"=RC[-1]-RC[-2]"
'"=IF(RC[-6]=""USD Cash"","""",IF(RC[-1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL TO ZERO"",(IF(AND(RC[-
1]>0,RC[-3]=0),""NEW BUY"",IF(RC[-1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
Application.DisplayAlerts = False
wbsh1.Close
Application.DisplayAlerts = True
Sheets("VMAPInternalHoldings").Select
Range("J2:J" & Range("A" & Rows.Count).End(xlUp).Row) = "=IF(RC[-8]=""MODABA"",RC[-3]/SUMIF(R2C[-
8]:R10000C[-8],""MODABA"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODABC"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODABC"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODABG"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODABG"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODSBA"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODSBA"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODSBC"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODSBC"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODSBG"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODSBG"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODBGE"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODBGE"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODBUE"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODBUE"",R2C[-3]:R10000C[-3]),(IF(RC[-8]=""MODBIN"",RC[-3]/SUMIF(R2C[-8]:R10000C[-
8],""MODBIN"",R2C[-3]:R10000C[-3]),""n/a"")))))))))))))))))"
Range("K2:K" & Range("A" & Rows.Count).End(xlUp).Row) = "=RC[-8]"
Range("L2:L" & Range("A" & Rows.Count).End(xlUp).Row) = "=IFERROR(VLOOKUP(RC[-11],'PM-Allweight'!R2C[-
11]:R1000C[-5],6,FALSE),0)"
Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row) = "=RC[-1]-RC[-3]"
Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row) = "=IF(RC[-3]=""USD Cash"","""",IF(RC[-
1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL TO ZERO"",(IF(AND(RC[-1]>0,RC[-4]=0),""NEW BUY"",IF(RC[-
1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
Range("J1:N1") = Array("Calculated Weight", "Ticker", "New Pct", "Chg Pct", "B/S")
Sheets("PM-Allweight").Select
[A1].Select
Range("H2:H" & Range("A" & Rows.Count).End(xlUp).Row) = "=IFERROR(VLOOKUP(RC[-
7],VMAPInternalHoldings!c1,1,FALSE),""Missing Sec"")"
' Range("I2:I" & Range("A" & Rows.Count).End(xlUp).Row) = "=IFERROR(VLOOKUP(RC[-
8],VMAPInternalHoldings!R2C[-8]:R1000C[-2],6,FALSE),0)"
' Range("J2:J" & Range("A" & Rows.Count).End(xlUp).Row) = "=RC[-1]-RC[-2]"
' Range("K2:K" & Range("A" & Rows.Count).End(xlUp).Row) = "=IF(RC[-6]=""USD Cash"","""",IF(RC[-
1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL TO ZERO"",(IF(AND(RC[-1]>0,RC[-3]=0),""NEW BUY"",IF(RC[-
1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
' Range("H1:K1") = Array("Calculated Weight", "New Pct", "Chg Pct", "B/S")
' Cells.EntireColumn.AutoFit
Range("H2:H" & Range("A" & Rows.Count).End(xlUp).Row).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ActiveSheet.UsedRange.Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="Missing Sec"
Selection.AutoFilter Field:=6, Criteria1:="<>0"
Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("A" & Rows.Count).End(xlUp)(2)
Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("B" & Rows.Count).End(xlUp)(2)
Range("E2:E" & Range("C" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("C" & Rows.Count).End(xlUp)(2)
Range("E2:E" & Range("C" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("K" & Rows.Count).End(xlUp)(2)
Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).Copy
Destination:=Sheets("VMAPInternalHoldings").Range("L" & Rows.Count).End(xlUp)(2)
Sheets("VMAPInternalHoldings").Range("M2:M" & Sheets("VMAPInternalHoldings").Range("A" &
Rows.Count).End(xlUp).Row) = "=RC[-1]-RC[-3]"
Sheets("VMAPInternalHoldings").Range("N2:N" & Sheets("VMAPInternalHoldings").Range("A" &
Rows.Count).End(xlUp).Row) = "=IF(RC[-3]=""USD Cash"","""",IF(RC[-1]=0,"""",(IF(AND(RC[-1]<0,RC[-2]=0),""SELL
TO ZERO"",(IF(AND(RC[-1]>0,RC[-4]=0),""NEW BUY"",IF(RC[-1]>0,""BUY"",(IF(RC[-1]<0,""SELL"","""")))))))))"
Cells.AutoFilter
Columns("H").Clear
Sheets("VMAPInternalHoldings").Select
CoditionalFormattting
Cells.EntireColumn.AutoFit
ActiveSheet.UsedRange.Borders.LineStyle = xlContinuous
Application.DisplayAlerts = False
Columns("L:M").NumberFormat = "0.00%"
[A1].Select
Cells.HorizontalAlignment = xlLeft
Columns("N:N").Select
Selection.Cut
Columns("L:L").Select
Selection.Insert Shift:=xlToRight
Range("L1").Select
ActiveSheet.Name = "Primerica"
Range("A1:N" & Range("A" & Rows.Count).End(xlUp).Row).Select
Selection.AutoFilter Field:=2, Criteria1:=Array("MODBGE", "MODBIN", "MODBUE"), Operator:=xlFilterValues
[A1].Select
ActiveWorkbook.SaveAs Filename:=mypath + "Primerica Recon-Output.xls", FileFormat:=xlExcel8
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "File saved in given Path...!"
End Sub
Function CoditionalFormattting()
End Function