Nanogirl21
Active Member
- Joined
- Nov 19, 2013
- Messages
- 331
- Office Version
- 365
- Platform
- Windows
Hi,
Can someone please help shorten this code.
Thank you.
Can someone please help shorten this code.
Thank you.
Code:
Sheets("SMMRY - WO BY DAYS IN ROLE").Select
Set pvt = ActiveSheet.PivotTables("PivotTable1")
pvt.ColumnGrand = False
pvt.RowGrand = False
pvt.RowAxisLayout xlTabularRow
pvt.ClearTable
'FILTERS
'FALSE IS ITEMS I DON'T WANT TO SEE
Set pvt = ActiveSheet.PivotTables("PivotTable1").PivotFields("CCC Affected WO Fltr")
pvt.EnableMultiplePageItems = True
pvt.PivotItems("No").Visible = False
Set pvt = ActiveSheet.PivotTables("PivotTable1").PivotFields("GFLT")
pvt.EnableMultiplePageItems = True
pvt.PivotItems("Powertrain").Visible = False
Set pvt = ActiveSheet.PivotTables("PivotTable1").PivotFields("WO Type")
pvt.EnableMultiplePageItems = True
pvt.PivotItems("AWO").Visible = False
pvt.PivotItems("BMB").Visible = False
pvt.PivotItems("BSD").Visible = False
pvt.PivotItems("CES").Visible = False
pvt.PivotItems("MWO").Visible = False
pvt.PivotItems("PSO").Visible = False
pvt.PivotItems("SCE").Visible = False
pvt.PivotItems("SWO").Visible = False
pvt.PivotItems("TWO").Visible = False
pvt.PivotItems("VWO").Visible = False
Set pvt = ActiveSheet.PivotTables("PivotTable1").PivotFields("WO Sub Type")
pvt.EnableMultiplePageItems = True
pvt.PivotItems("01, * Accessory").Visible = False
pvt.PivotItems("10, Asm Plant Process Chg").Visible = False
pvt.PivotItems("11, * SOR").Visible = False
pvt.PivotItems("12, * DLS Increment").Visible = False
pvt.PivotItems("13, * MPL Correction").Visible = False
pvt.PivotItems("15, ").Visible = False
pvt.PivotItems("15, Further Tooling Release").Visible = False
pvt.PivotItems("16, * Dwg Chg No Dsgn Effect").Visible = False
pvt.PivotItems("19, Drwg Chg, Dsgn Effected").Visible = False
pvt.PivotItems("21, * U Release").Visible = False
pvt.PivotItems("23, AWO-Engr Code Maint Req").Visible = False
pvt.PivotItems("24, Initial PAD/MPP Release").Visible = False
pvt.PivotItems("25, * Color Release").Visible = False
pvt.PivotItems("26, ").Visible = False
pvt.PivotItems("26, CES - To GMPT").Visible = False
pvt.PivotItems("30, ").Visible = False
pvt.PivotItems("30, Service Chg Understudy").Visible = False
pvt.PivotItems("31, Service Modify Create").Visible = False
pvt.PivotItems("35, Production").Visible = False
pvt.PivotItems("36, Pre-Production").Visible = False
pvt.PivotItems("37, Tooling").Visible = False
pvt.PivotItems("39, * S Release").Visible = False
pvt.PivotItems("40, Pwrtrn - Source Chg").Visible = False
pvt.PivotItems("A0, Cost Approval Only").Visible = False
pvt.PivotItems("A1, ").Visible = False
pvt.PivotItems("A1, Init Tooling Release").Visible = False
pvt.PivotItems("A2, ").Visible = False
pvt.PivotItems("A2, Init Production Release").Visible = False
pvt.PivotItems("A3, ").Visible = False
pvt.PivotItems("A3, Late Release").Visible = False
pvt.PivotItems("A4, * Create").Visible = False
pvt.PivotItems("A5, NPN Understudy").Visible = False
pvt.PivotItems("A6, ").Visible = False
pvt.PivotItems("A6, Change Understudy").Visible = False
pvt.PivotItems("A7, Lift Order").Visible = False
pvt.PivotItems("A9, Manufacturing Release").Visible = False
pvt.PivotItems("AD, Admin. chg. blanket w.o.").Visible = False
pvt.PivotItems("AM, Alt Cmpt Matl or Const.").Visible = False
pvt.PivotItems("AN, ").Visible = False
pvt.PivotItems("AP, Alternative Asm Process").Visible = False
pvt.PivotItems("AR, ").Visible = False
pvt.PivotItems("AS, ").Visible = False
pvt.PivotItems("AU, ").Visible = False
pvt.PivotItems("AX, ").Visible = False
pvt.PivotItems("BC, BMB - BOM Change Request").Visible = False
pvt.PivotItems("BO, ").Visible = False
pvt.PivotItems("BOM, ").Visible = False
pvt.PivotItems("BOM, BMB - BOM Change Request").Visible = False
pvt.PivotItems("CD, Clean Dwg.").Visible = False
pvt.PivotItems("DS, PSO - Design Study").Visible = False
pvt.PivotItems("DT, ").Visible = False
pvt.PivotItems("ET, Engineering Try Out").Visible = False
pvt.PivotItems("EX, BMB - Expedited Tooling").Visible = False
pvt.PivotItems("IM, ").Visible = False
pvt.PivotItems("LL, Label Logic").Visible = False
pvt.PivotItems("MC, Modify / Create").Visible = False
pvt.PivotItems("MO, BMB - Misc Mat'l Order").Visible = False
pvt.PivotItems("MP, ").Visible = False
pvt.PivotItems("MS, Material Substitution").Visible = False
pvt.PivotItems("MU, ").Visible = False
pvt.PivotItems("NN, * Non Impact Notify-NIN").Visible = False
pvt.PivotItems("NR, ").Visible = False
pvt.PivotItems("OM, Obsolete Material").Visible = False
pvt.PivotItems("PA, * Reference Usage Chg").Visible = False
pvt.PivotItems("PM, BMB - Matl Req").Visible = False
pvt.PivotItems("PO, ").Visible = False
pvt.PivotItems("PR, ").Visible = False
pvt.PivotItems("PS, ").Visible = False
pvt.PivotItems("PT, BMB - Pre-Prod Tooling").Visible = False
pvt.PivotItems("RE, ").Visible = False
pvt.PivotItems("RP, ").Visible = False
pvt.PivotItems("RP, Rework (Plant)").Visible = False
pvt.PivotItems("RS, Rework (Source)").Visible = False
pvt.PivotItems("SA, Static Torque").Visible = False
pvt.PivotItems("SC, *Service Chg only").Visible = False
pvt.PivotItems("SL, ").Visible = False
pvt.PivotItems("SL, Special Projects").Visible = False
pvt.PivotItems("SP, Dwg. chg. to dwg. spec.").Visible = False
pvt.PivotItems("SR, ").Visible = False
pvt.PivotItems("ST, Stop Order").Visible = False
pvt.PivotItems("SU, ").Visible = False
pvt.PivotItems("V1, VDS Corr No Prt Impact").Visible = False
pvt.PivotItems("V2, VDS Administration").Visible = False
pvt.PivotItems("V3, VDS Corr w/Part Impact").Visible = False
pvt.PivotItems("VD, VDS chg. w/part impact").Visible = False
pvt.PivotItems("VN, VDS Chg No Part Impact").Visible = False
pvt.PivotItems("VP, VDS not Chg'g- Part Only").Visible = False
pvt.PivotItems("WS, Work Share").Visible = False
'COLUMNS
Set pvt = ActiveSheet.PivotTables("PivotTable1")
pvt.PivotFields("WO").Orientation = xlRowField
pvt.PivotFields("LEAD WO").Orientation = xlRowField
pvt.PivotFields("Product Line").Orientation = xlRowField
pvt.PivotFields("YEAR").Orientation = xlRowField
pvt.PivotFields("Prgrms").Orientation = xlRowField
pvt.PivotFields("Engineering Region").Orientation = xlRowField
pvt.PivotFields("GFLT").Orientation = xlRowField
pvt.PivotFields("WO Subject").Orientation = xlRowField
pvt.PivotFields("WO Priority Code").Orientation = xlRowField
pvt.PivotFields("WO Sub Type").Orientation = xlRowField
pvt.PivotFields("WO Reason Description").Orientation = xlRowField
pvt.PivotFields("CCC Affected WO Fltr").Orientation = xlRowField
pvt.PivotFields("WO Subject").Orientation = xlRowField
pvt.PivotFields("RoleCode").Orientation = xlRowField
pvt.PivotFields("User Name").Orientation = xlRowField
pvt.PivotFields("Days In Role").Orientation = xlRowField
pvt.PivotFields("True WO Status").Orientation = xlRowField
pvt.PivotFields("Order_By_No").Orientation = xlRowField
pvt.PivotFields("WO Init Date").Orientation = xlRowField
pvt.PivotFields("PROC_DATE").Orientation = xlRowField
pvt.PivotFields("Has Cost Info").Orientation = xlRowField
ActiveSheet.PivotTables("PivotTable1").RepeatAllLabels xlRepeatLabels
ActiveSheet.PivotTables("PivotTable1").PivotFields("WO"). _
Subtotals = Array(False, False, False, False, False, False, False, False, False, False, _
False, False)
Selection.Copy
MsgBox "Metrics Complete"
End Sub