0% found this document useful (0 votes)
289 views

Macro VB

This document contains VBA code to perform the following: 1. Clear existing data in the Recon sheet and copy over new data from the VMAP sheet. 2. Format and clean data from the UBS, MS-MainFrame, and MS-CGTrade sheets. This includes text to column formatting, replacing values, and filtering. 3. Use VLOOKUP formulas to pull over values from the source sheets into the Recon sheet. Formulas are also added to calculate differences between values. 4. Values from formulas are copied over as static values. Remaining cleanup includes replacing errors and filtering. The document contains macros to process the UBS, MS-MainFrame,

Uploaded by

Bala Ranganath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views

Macro VB

This document contains VBA code to perform the following: 1. Clear existing data in the Recon sheet and copy over new data from the VMAP sheet. 2. Format and clean data from the UBS, MS-MainFrame, and MS-CGTrade sheets. This includes text to column formatting, replacing values, and filtering. 3. Use VLOOKUP formulas to pull over values from the source sheets into the Recon sheet. Formulas are also added to calculate differences between values. 4. Values from formulas are copied over as static values. Remaining cleanup includes replacing errors and filtering. The document contains macros to process the UBS, MS-MainFrame,

Uploaded by

Bala Ranganath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 326

1.

VMAP MS UBS HOLDINGS MACRO

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

Set wks = ActiveSheet


With wks
col = ActiveCell.Column
'or
'col = .range("I1").column

Set rng = .UsedRange 'try to reset the lastcell


LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set rng = Nothing
On Error Resume Next
Set rng = .Range(.Cells(2, col), .Cells(LastRow, col)) _
.Cells.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If rng Is Nothing Then


MsgBox "No blanks found"
Exit Sub
Else
rng.FormulaR1C1 = "=R[-1]C"
End If

'replace formulas with values


With .Cells(1, col).EntireColumn
.Value = .Value
End With
End With
Range("C1").EntireColumn.Insert
Range("D:D").Copy
Range("C1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("C:C").Select
Selection.Replace What:="TOTAL ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="Cash and Equivalen", Replacement:="USD Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="*MONEY MKT. PORTFOLIO*", Replacement:="USD Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDSB", Replacement:="RDS B", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

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

Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=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

Selection.TextToColumns Destination:=Range("B1"), DataType:=xlFixedWidth, _


FieldInfo:=Array(Array(0, 1), Array(11, 1), Array(21, 1), Array(41, 1), Array(52, 1), _
Array(75, 1)), TrailingMinusNumbers:=True

Cells.Select
Cells.EntireColumn.AutoFit
Columns("B:B").Select
Cells.Replace What:=" ", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False

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

Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="BDPS", Replacement:="USD Cash", 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

Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=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

Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False

End Sub

2. Data Extract Macro from website

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _


"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, _
ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetModuleHandle Lib "kernel32" Alias _
"GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" _
(ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, _
ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Private Declare Function SendDlgItemMessage Lib "user32" Alias "SendDlgItemMessageA" _
(ByVal hDlg As Long, ByVal nIDDlgItem As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
(ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function GetCurrentThreadId Lib "kernel32" () As Long
'~~> Constants to be used in our API functions
Private Const EM_SETPASSWORDCHAR = &HCC
Private Const WH_CBT = 5
Private Const HCBT_ACTIVATE = 5
Private Const HC_ACTION = 0
Private hHook As Long
Sub SMA_Autiomation()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Dim UserID, PASW As String
Dim loc As String
Dim dateP, dataT As Date
Dim Prompt, Prompt1, password As String
Prompt1 = InputBoxDK("Please enter UserName password.")
Prompt = InputBoxDK("Please enter your password.")
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "https://manager.envestnet.com/secure/login/login.jsp"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set objCollection = IE.document.getElementsByTagName("input")
i=0
While i < objCollection.Length
If objCollection(i).Name = "user" Then
objCollection(i).Value = Prompt1
ElseIf objCollection(i).Name = "password" Then
objCollection(i).Value = Prompt
Else
If objCollection(i).Name = "login" Then
Set objElement = objCollection(i)
End If
End If
i=i+1
Wend
Application.Wait (Now + TimeValue("00:00:02"))
SendKeys "{TAB 3}", True
Application.Wait (Now + TimeValue("00:00:02"))
SendKeys "{ENTER}", True
End Sub
Public Function NewProc(ByVal lngCode As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Dim RetVal
Dim strClassName As String, lngBuffer As Long
If lngCode < HC_ACTION Then
NewProc = CallNextHookEx(hHook, lngCode, wParam, lParam)
Exit Function
End If
strClassName = String$(256, " ")
lngBuffer = 255
If lngCode = HCBT_ACTIVATE Then
RetVal = GetClassName(wParam, strClassName, lngBuffer)
'~~> Class name of the Inputbox
If Left$(strClassName, RetVal) = "#32770" Then
'~~> This changes the edit control so that it display the password character *.
'~~> You can change the Asc("*") as you please.
SendDlgItemMessage wParam, &H1324, EM_SETPASSWORDCHAR, Asc("*"), &H0
End If
End If
'~~> This line will ensure that any other hooks that may be in place are
'~~> called correctly.
CallNextHookEx hHook, lngCode, wParam, lParam
End Function
Public Function InputBoxDK(Prompt, Optional Title, Optional Default, Optional XPos, _
Optional YPos, Optional HelpFile, Optional Context) As String
Dim lngModHwnd As Long, lngThreadID As Long
lngThreadID = GetCurrentThreadId
lngModHwnd = GetModuleHandle(vbNullString)
hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID)
InputBoxDK = InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context)
UnhookWindowsHookEx hHook
End Function
3. MSSB 7 WEEKLY MACRO

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

Cells.Replace What:="RDS/B", Replacement:="RDS B", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False

Cells.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=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"

If ActiveCell = "" Then

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

Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False

Cells.Replace What:="Data", Replacement:="", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="Account Name ", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
'Set wb2 = Workbooks("Accumulation Rates 2012.xls")

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

Selection.Replace What:=" US", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:=".ADR", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:=".NY", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:=".W", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="2", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="*WORK.CAP.", Replacement:="Working Capital -1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="Working Capital -1", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="BNL", Replacement:="BZLFY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CANNY", Replacement:="CAJ", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="PRSNY", Replacement:="PSO", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="HUW", Replacement:="HUWHY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="TEVIY", Replacement:="TEVA", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="ERICD", Replacement:="ERIC", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS.B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

'Delete's column headers

'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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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"

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco


VMAP Models\MODIEF.csv"

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

Selection.Replace What:="RDS B", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RDS A", Replacement:="RDSA", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco


VMAP Models\MODIEF.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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

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

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODIEF.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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\MODIEF.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

Selection.Replace What:="RDSB", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDSA", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="MOG A", Replacement:="MOG.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="JW A", Replacement:="JW.A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="MOG A", Replacement:="MOG'A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="JW A", Replacement:="JW'A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
' Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

'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

' Range("A65536").End(xlUp).Offset(2, 2).Select

' With ActiveCell

' Set Rng1 = Range(.Offset(-1, -2), .Offset(-2, -0).End(xlUp))

'Set Rng2 = Range(.Offset(-1, 0), .Offset(-2, 0).End(xlUp))


'.Formula = "=SUMif(" & Rng1.Address & ",""USD Cash""," & Rng2.Address & ")"
'End With

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

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(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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

'Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

'Selection.Replace What:="MOG--A", Replacement:="MOG/A", LookAt:=xlPart, _


' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False

Selection.Replace What:="JW A", Replacement:="JW---A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="MOG A", Replacement:="MOG/A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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("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"
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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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"

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

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

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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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"

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODGLO.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(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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODVAL.csv"

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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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

Selection.Replace What:="RDS'A", Replacement:="RDSA", 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\MODVAL.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

Selection.Replace What:="RDS B", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDSA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
' Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODDIV.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USD Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook


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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODIEF.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

Selection.Replace What:="RDS B", Replacement:="RDS--B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS--A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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("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.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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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\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("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="MOG A", Replacement:="MOG--A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="JW A", Replacement:="JW--A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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("D3").FormulaR1C1 = "Port %"


Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"

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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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("D3").FormulaR1C1 = "Port %"


Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"

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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook


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 = "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\MODGLO.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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("D3").FormulaR1C1 = "Port %"


Range("E3").FormulaR1C1 = "Difference"
Range("G3").FormulaR1C1 = "Invesco_Ticker"
Range("H3").FormulaR1C1 = "% of Portfolio"

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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODVAL.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

Selection.Replace What:="RDS B", Replacement:="RDS--B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS--A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
' Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

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

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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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").FormulaR1C1 = "ENV INTL"

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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODGLO.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="BRK B", Replacement:="BRK.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
' Cells.Replace What:="#N/A", Replacement:="", 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 = "ENV GLO"

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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

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

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("A:A").Select
Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="JW A", Replacement:="JW.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="MOG A", Replacement:="MOG.A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODLCC.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook


'Set wb2 = Workbooks("Accumulation Rates 2012.xls")

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

Selection.Replace What:=" US", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:=".ADR", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:=".NY", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:=".W", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="2", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="*WORK.CAP.", Replacement:="Working Capital -1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="Working Capital -1", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="BNL", Replacement:="BZLFY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CANNY", Replacement:="CAJ", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="PRSNY", Replacement:="PSO", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="HUW", Replacement:="HUWHY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="TEVIY", Replacement:="TEVA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="ERICD", Replacement:="ERIC", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS.B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

'Delete's column headers

'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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _


:=False, Transpose:=False

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"

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco


VMAP Models\MODFDI.csv"

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

'Selection.Replace What:="RDS B", Replacement:="RDSB", LookAt:=xlPart, _


'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDSA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="USD Cash", Replacement:=" FDX CASH", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _


:=False, Transpose:=False

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"

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco


VMAP Models\MODIEF.csv"

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

'Selection.Replace What:="RDS B", Replacement:="RDSB", LookAt:=xlPart, _


'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDSA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:=" FDX CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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.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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

'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

' Range("A65536").End(xlUp).Offset(2, 2).Select

' With ActiveCell

' Set Rng1 = Range(.Offset(-1, -2), .Offset(-2, -0).End(xlUp))

'Set Rng2 = Range(.Offset(-1, 0), .Offset(-2, 0).End(xlUp))


'.Formula = "=SUMif(" & Rng1.Address & ",""USD Cash""," & Rng2.Address & ")"
'End With

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco


VMAP Models\MODIEF.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(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

Selection.Replace What:="RDS/B ", Replacement:="RDS B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

'Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _


'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

'Selection.Replace What:="MOG--A", Replacement:="MOG/A", LookAt:=xlPart, _


' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False

Selection.Replace What:="JW A", Replacement:="JW---A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="MOG A", Replacement:="MOG/A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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("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.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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

'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

' Range("A65536").End(xlUp).Offset(2, 2).Select

' With ActiveCell

' Set Rng1 = Range(.Offset(-1, -2), .Offset(-2, -0).End(xlUp))

'Set Rng2 = Range(.Offset(-1, 0), .Offset(-2, 0).End(xlUp))


'.Formula = "=SUMif(" & Rng1.Address & ",""USD Cash""," & Rng2.Address & ")"
'End With

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

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(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

Selection.Replace What:="RDS/B ", Replacement:="RDS B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.Replace What:="USD Cash", Replacement:="CASH-1", LookAt:=xlPart, _
'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

'Selection.Replace What:="MOG--A", Replacement:="MOG/A", LookAt:=xlPart, _


' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False

Selection.Replace What:="JW A", Replacement:="JW---A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="MOG A", Replacement:="MOG/A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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("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"
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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _


:=False, Transpose:=False

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"

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model Comparisons\Invesco


VMAP Models\MODVAL.csv"

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

'Selection.Replace What:="RDS B", Replacement:="RDSB", LookAt:=xlPart, _


'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDSA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:=" FDX CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODVAL.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="MOG A", Replacement:="MOG.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="JW A", Replacement:="JW.A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Range("A1").Select
'Cells.Replace What:="#N/A", Replacement:="", 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

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

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODIEF.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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

Selection.AutoFilter Field:=1, Criteria1:=">=<>0", _


Operator:=xlAnd, Criteria1:="="
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[8]"

Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter

Columns("A:A").Select

Selection.AutoFilter Field:=1, Criteria1:="", _


Operator:=xlAnd

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

Cells.Replace What:="RDS--B", Replacement:="RDS B", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False

Cells.Replace What:="CASH-1", Replacement:="USD Cash", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False

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

Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
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

Selection.AutoFilter Field:=1, Criteria1:=">=<>0", _


Operator:=xlAnd, Criteria1:="="
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[9]"

Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFilter

Columns("A:A").Select

Selection.AutoFilter Field:=1, Criteria1:="", _


Operator:=xlAnd

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

Cells.Replace What:="RDSB", Replacement:="RDS B", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False

Cells.Replace What:="CASH-1", Replacement:="USD Cash", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False
Range("A1").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("APL").Select

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _


FieldInfo:=Array(Array(0, 1), Array(11, 1), Array(56, 1), Array(67, 1), Array(76, 1), _
Array(83, 1), Array(101, 1), Array(109, 1), Array(117, 1)), TrailingMinusNumbers:= _
True

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

Cells.Replace What:="CASH-1", Replacement:="USD Cash", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False

Cells.Replace What:="USD Cash 1,", Replacement:="USD Cash", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False
Columns("F:F").Insert
Range("F1").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],Recon!R4C2:R1075C4,1,0)"
Selection.Copy
Range("E1").Select
Selection.End(xlDown).Select
Selection.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("F:F").Insert
Columns("E:E").Select

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

Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _


:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Application.CutCopyMode = False

End Sub

Trading UMA Model comparison Macro:


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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
'Set wb2 = Workbooks("Accumulation Rates 2012.xls")

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

Selection.Replace What:=" US", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="1", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:=".ADR", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:=".NY", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:=".W", Replacement:="", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="2", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="*WORK.CAP.", Replacement:="Working Capital -1", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="BNL", Replacement:="BZLFY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CANNY", Replacement:="CAJ", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="PRSNY", Replacement:="PSO", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="HUW", Replacement:="HUWHY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="SHPGY", Replacement:="SHPG", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="TEVIY", Replacement:="TEVA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="ERICD", Replacement:="ERIC", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS.B", Replacement:="RDS--B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=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

'Delete's column headers

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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--A", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
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\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

Selection.Replace What:="RDS--B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="NSRGY", Replacement:="3NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="RHHBY", Replacement:="3RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

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\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

Selection.Replace What:="RDS--B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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 = "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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

'Selection.Replace What:="NSRGY", Replacement:="3NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Selection.Replace What:="RHHBY", Replacement:="3RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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("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

Dim wb1 As Workbook


Dim wb2 As Workbook

Set wb1 = ActiveWorkbook

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

Set Rng1 = Range(.Offset(-1, -2), .Offset(-2, -0).End(xlUp))

Set Rng2 = Range(.Offset(-1, 0), .Offset(-2, 0).End(xlUp))


.Formula = "=SUMif(" & Rng1.Address & ",""CASH-1""," & Rng2.Address & ")"
End With

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

' Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _


' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False

' Selection.Replace What:="RDS--A", Replacement:="RDSB", LookAt:=xlPart, _


'SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

'Selection.Replace What:="NSRGY", Replacement:="3NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Selection.Replace What:="RHHBY", Replacement:="3RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="USDCASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

'Selection.Replace What:="NSRGY", Replacement:="3NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
' Selection.Replace What:="RHHBY", Replacement:="3RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS.B", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

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

Selection.Replace What:="RDS'A", Replacement:="RDSA", 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

Selection.Replace What:="RDS--B", Replacement:="RDSB", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDSA", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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 = "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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook

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

Selection.Replace What:="RDS--B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS--A", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="CASH-1", Replacement:="USD Cash", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="#N/A", Replacement:="", 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

Dim wb1 As Workbook


Dim wb2 As Workbook
Set wb1 = ActiveWorkbook
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 3), Array(10, 3), Array(20, 2), Array(36, 1), Array(76, 1), _
Array(79, 1), Array(88, 1), Array(126, 1), Array(142, 1), Array(151, 1), Array(170, 1)), _
TrailingMinusNumbers:=True

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

ENVESTNET ETF UMA MACRO


Sub MODABA()

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 = "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

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

Workbooks.OpenText Filename:="S:\APAM\OPERATIONS\Model Comparison\Vestmark Model


Comparisons\Invesco VMAP Models\MODABA.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

Selection.Replace What:="RDS B", Replacement:="RDS.B", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="RDS A", Replacement:="RDS.A", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="USD Cash", Replacement:="CASH", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Selection.Replace What:="3NSRGY", Replacement:="NSRGY", LookAt:=xlPart, _


SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="3RHHBY", Replacement:="RHHBY", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
Cells.Replace What:="#N/A", Replacement:="", 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").FormulaR1C1 = "ENV ABA"

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:

Const file1 As String = "SMA Weight" & "*"


Const file2 As String = "VMAPinternalHoldings" & "*"
Const template As String = "ETF Model update Phase 1 June 1" & "*"
Const sheet1 As String = "AllWeight"
Sub ETF_MACRO()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
If Sheets("MACRO").[I26] = "" Then
MsgBox "Please Paste The Path...!"
Exit Sub
End If
mypath = Sheets("MACRO").[I26]
If Right(mypath, 1) = "\" Then
mypath = mypath
Else
mypath = mypath + "\"
End If

Workbooks.Open (mypath + file2)


Set wbsh2 = ActiveWorkbook
ActiveSheet.Name = "VMAPInternalHoldings"
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, Tab:=True, Other:=True, OtherChar:="|", FieldInfo:=Array(Array(1, 1), Array(2,
1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1), Array(8, 1)), TrailingMinusNumbers:=True
Columns(1).Insert
Range("A1:A" & Range("B" & Rows.Count).End(xlUp).Row) = "=CONCATENATE(RC[1],RC[2])"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets.Add.Name = "PM-Allweight"

Workbooks.Open (mypath + file1)


Set wbsh1 = ActiveWorkbook
Columns(3).Replace what:="CASH", replacement:="USD Cash"
Columns("A:B").Insert
Range("B2:B" & Range("C" & Rows.Count).End(xlUp).Row) = "=IF(RC[2]=""Conservative Growth Strategic
Balanced SMA"",""MODSBC"",(IF(RC[2]=""Moderate Growth Strategic Balanced
SMA"",""MODSBG"",(IF(RC[2]=""Growth Strategic Balanced SMA"",""MODSBA"",(IF(RC[2]=""Conservative Growth
Active Balanced SMA"",""MODABC"",(IF(RC[2]=""Moderate Growth Active Balanced
SMA"",""MODABG"",(IF(RC[2]=""Growth Active Balanced SMA"",""MODABA"",1)))))))))))"
Range("A2:A" & Range("C" & Rows.Count).End(xlUp).Row) = "=CONCATENATE(RC[1],RC[4])"
Range("A1:B1") = Array("AcctIdSecId", "Ticker")
wbsh1.Sheets(sheet1).Cells.Copy Destination:=wbsh2.Sheets("PM-Allweight").Cells(1, 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()

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select

Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, Formula1:="=-0.05%",


Formula2:="=0.05%"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).StopIfTrue = False

Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""SELL TO ZERO"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""NEW BUY"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561030
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""BUY"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""SELL"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("J2:J" & Range("A" & Rows.Count).End(xlUp).Row).Select


With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
Rows("1:1").Font.Bold = True
Range("A1:N1").Style = "Accent1"

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"","""")))))))))"

ETF AUTOMATION (PRIMERICA)


Const file1 As String = "Primerica_Weight_Client" & "*"
Const file2 As String = "VMAPinternalHoldings" & "*"
Const template As String = "ETF Model update Phase 1 June 1" & "*"
Const sheet1 As String = "AllWeight"
Sub ETF_MACRO()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
If Sheets("MACRO").[I26] = "" Then
MsgBox "Please Paste The Path...!"
Exit Sub
End If
mypath = Sheets("MACRO").[I26]
If Right(mypath, 1) = "\" Then
mypath = mypath
Else
mypath = mypath + "\"
End If

Workbooks.Open (mypath + file2)


Set wbsh2 = ActiveWorkbook
ActiveSheet.Name = "VMAPInternalHoldings"
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, Tab:=True, Other:=True, OtherChar:="|", FieldInfo:=Array(Array(1, 1), Array(2,
1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1), Array(8, 1)), TrailingMinusNumbers:=True
Columns(1).Insert
Range("A1:A" & Range("B" & Rows.Count).End(xlUp).Row) = "=CONCATENATE(RC[1],RC[2])"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets.Add.Name = "PM-Allweight"

Workbooks.Open (mypath + file1)


Set wbsh1 = ActiveWorkbook
Sheets("AllWeight").Select
Columns(3).Replace what:="CASH", replacement:="USD Cash"
Columns("A:B").Insert
Range("B2:B" & Range("C" & Rows.Count).End(xlUp).Row) = "=IF(RC[2]=""Primerica Global
Equity"",""MODBGE"",(IF(RC[2]=""Primerica US Equity"",""MODBUE"",(IF(RC[2]=""Primerica
Income"",""MODBIN"",(IF(RC[2]=""Conservative Growth Active Balanced
SMA"",""MODABC"",(IF(RC[2]=""Moderate Growth Active Balanced SMA"",""MODABG"",(IF(RC[2]=""Growth
Active Balanced SMA"",""MODABA"",1)))))))))))"
Range("A2:A" & Range("C" & Rows.Count).End(xlUp).Row) = "=CONCATENATE(RC[1],RC[4])"
Range("A1:B1") = Array("AcctIdSecId", "Ticker")
wbsh1.Sheets(sheet1).Cells.Copy Destination:=wbsh2.Sheets("PM-Allweight").Cells(1, 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]),(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()

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select

Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, Formula1:="=-0.05%",


Formula2:="=0.05%"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Color = -16383844
.TintAndShade = 0
.Weight = xlThin
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("M2:M" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).StopIfTrue = False
Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""SELL TO ZERO"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""NEW BUY"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561030
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""BUY"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("N2:N" & Range("A" & Rows.Count).End(xlUp).Row).Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""SELL"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("J2:J" & Range("A" & Rows.Count).End(xlUp).Row).Select


With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
Rows("1:1").Font.Bold = True
Range("A1:N1").Style = "Accent1"

End Function

You might also like