Hi i am a novice and i am looking to get this macro to work; however, i get an error in the end saying " compile error: end with or end sub "
thanks,
Maulik.
'
Sheets("Large MBS Diff").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME")
.PivotItems("SBA").Visible = True
.PivotItems("CMBS Only").Visible = False
.PivotItems("MBS").Visible = False
Range("A2").Select
ActiveCell.FormulaR1C1 = "SBA trader marks vs. other pricing sources"
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "N").End(xlUp).Row
.PageSetup.PrintArea = "A1:N" & LastRow
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME")
.PivotItems("Munis").Visible = True
.PivotItems("SBA").Visible = False
Range("A2").Select
ActiveCell.FormulaR1C1 = "Municipal Bond trader marks vs. other pricing sources"
With ActiveSheet
LastRow = .Cells(.Rows.Count, "N").End(xlUp).Row
.PageSetup.PrintArea = "A1:N" & LastRow
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME")
.PivotItems("Emerging Markets").Visible = True
.PivotItems("Munis").Visible = False
Range("A2").Select
ActiveCell.FormulaR1C1 = "EM trader marks vs. other pricing sources"
With ActiveSheet
LastRow = .Cells(.Rows.Count, "N").End(xlUp).Row
.PageSetup.PrintArea = "A1:N" & LastRow
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME")
.PivotItems("US IG").Visible = True
.PivotItems("US HY").Visible = True
.PivotItems("Emerging Markets").Visible = False
Range("A2").Select
ActiveCell.FormulaR1C1 = "Corporate Bonds trader marks vs. other pricing sources"
With ActiveSheet
LastRow = .Cells(.Rows.Count, "N").End(xlUp).Row
.PageSetup.PrintArea = "A1:N" & LastRow
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable1").PivotFields("NAME")
.PivotItems("MBS").Visible = True
.PivotItems("CMBS Only").Visible = True
.PivotItems("US IG ").Visible = False
.PivotItems("US HY").Visible = False
End With
Range("A2").Select
ActiveCell.FormulaR1C1 = "MBS trader marks vs. other pricing sources"
Sheets("MDGT marks").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
End Sub
Moderators note: code tags added for you - this time
Bookmarks