Attribute VB_Name = "Macro" ' ' Bond_Haircuts Macro ' This macro is to populate the bond haircut spreadsheet. ' ' Macro recorded 10/26/94 by Kenneth Golde ' ' Sub Bond_Haircuts() Attribute Bond_Haircuts.VB_Description = "This macro is to populate the bond haircut spreadsheet. Macro recorded 10/26/94 by Kenneth Golde" Attribute Bond_Haircuts.VB_ProcData.VB_Invoke_Func = " \n0" ' Application.ScreenUpdating = False Sheets("Bonds ").Select Cells.Item(1).Select Range("A6:H100").ClearContents Cells.Item(1281).Select ActiveCell.Rows("1:96").EntireRow.Select Selection.RowHeight = 16 Msg = "Do you want to use the PLRawOld file? 'Yes' for PLRawOld, 'No' for PLRaw, or 'Cancel' to abort this Macro." Style = vbYesNoCancel + vbDefaultButton1 Title = "File Input" Responce = MsgBox(Msg, Style, Title) 'Application.DisplayAlerts = False If Responce = vbYes Then Workbooks.Open Filename:="\\tja\sys\share\PLRAWOLD.DBF", ReadOnly:=True ElseIf Responce = vbNo Then Workbooks.Open Filename:="\\tja\\sys\share\PLRAW.DBF", ReadOnly:=True Else: GoTo Lastline End If Cells.Item(258).Select Selection.Copy Windows("BONDS.XLS").Activate Cells.Item(513).Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False ActiveSheet.Paste If Responce = vbYes Then Windows("PLRAWOLD.DBF").Activate Else Windows("PLRAW.DBF").Activate End If Cells.Item(1).Select ActiveCell.Columns("A:B").EntireColumn.Select Selection.Delete Shift:=xlToLeft ActiveCell.Offset(0, 6).Columns("A:A").EntireColumn.Select Selection.Copy ActiveWindow.SmallScroll ToRight:=-3 ActiveCell.Offset(0, -4).Columns("A:A").EntireColumn.Select Selection.Insert Shift:=xlToRight ActiveWindow.SmallScroll ToRight:=9 ActiveCell.Offset(0, 18).Columns("A:A").EntireColumn.Select Application.CutCopyMode = False Selection.Cut ActiveWindow.LargeScroll ToRight:=-2 ActiveCell.Offset(0, -17).Columns("A:A").EntireColumn.Select Selection.Insert Shift:=xlToRight ActiveWindow.SmallScroll ToRight:=10 ActiveCell.Offset(0, 17).Columns("A:A").EntireColumn.Select Selection.Cut ActiveWindow.SmallScroll ToRight:=-5 ActiveCell.Offset(0, -13).Columns("A:A").EntireColumn.Select Selection.Insert Shift:=xlToRight Cells.Item(1).Select Selection.Sort Key1:=ActiveCell, _ Order1:=xlAscending, _ Header:=xlGuess, _ OrderCustom:=1, _ MatchCase:=False, _ Orientation:=xlTopToBottom Selection.AutoFilter ActiveWindow.SmallScroll ToRight:=2 Selection.AutoFilter Field:=5, Criteria1:="<>0", Operator:=xlAnd ActiveWindow.SmallScroll ToRight:=8 Selection.AutoFilter Field:=16, Criteria1:="B" Cells.Item(1).Select ActiveCell.Range("A2:H2000").Select Selection.SpecialCells(xlVisible).Select Selection.Copy Windows("Bonds.xls").Activate Sheets("Bonds ").Select Cells.Item(1281).Select ActiveSheet.Paste If Responce = vbYes Then Windows("PLRAWOLD.DBF").Activate Else Windows("PLRAW.DBF").Activate End If ActiveWindow.Close SaveChanges:=False ActiveCell.Offset(0, 7).Columns("A:A").EntireColumn.Select Selection.Replace What:="190", _ Replacement:="200", _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False Selection.Replace What:="191", _ Replacement:="201", _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False Selection.Replace What:="192", _ Replacement:="202", _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False Cells.Item(1).Select ActiveCell.Offset(0, 4).Columns("A:B").EntireColumn.Select Selection.Style = "Comma" Selection.NumberFormat = "#,##0.0" Selection.NumberFormat = "#,##0" ActiveCell.Offset(0, -1).Columns("A:A").EntireColumn.Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = xlHorizontal End With ActiveCell.Offset(0, 3).Columns("A:A").EntireColumn.Select With Selection .HorizontalAlignment = xlRight .VerticalAlignment = xlBottom .WrapText = False .Orientation = xlHorizontal End With ActiveCell.Offset(6, 0).Range("A1").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = xlHorizontal End With ActiveCell.Offset(0, 1).Columns("A:A").EntireColumn.Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = xlHorizontal End With ActiveCell.Offset(0, -7).Range("A1").Select ActiveCell.Offset(2, 0).Range("A1").Select Selection.Font.Bold = True ' ActiveCell.Offset(-2, 0).Range("A1").Select Cells.Item(1).Select Range("A6:S101").Select With Selection.Font .Name = "Times New Roman" .Size = 9 End With Cells.Item(513).Select Selection.NumberFormat = """For the Close of Business on"" m/d/yy" ActiveCell.Range("A1:J1").Select With Selection .HorizontalAlignment = xlCenterAcrossSelection .VerticalAlignment = xlBottom .WrapText = False .Orientation = xlHorizontal End With ActiveCell.Select With Selection.Font .Name = "Times New Roman" .FontStyle = "Regular" .Size = 11 End With ActiveCell.Range("A4:A102").Select With Selection .HorizontalAlignment = xlCenter End With Cells.Item(1281).Select Counter = 0 Do While Counter < 95 If Selection <> "" Then ActiveCell.Offset(1, 0).Select Counter = Counter + 1 Else: ActiveCell.Rows("1:1").EntireRow.Select Selection.RowHeight = 0 ActiveCell.Offset(1, 0).Select Counter = Counter + 1 End If Loop Cells.Item(1).Select Lastline: End Sub