Adding titles to each table.
You've seen the code which does this for the previous tables, you just need to tweak it and add it.At msg#97 in this thread you've received plenty of help. You need to do some working out for yourself.Sub blah() Set PT = Sheets("Sheet6").Range("B6").PivotTable Set Destn = Sheets("Sheet6").Cells(Rows.Count, "W").End(xlUp).Offset(3) With PT Set pf = .PageFields("Tenure") For Each pit In pf.PivotItems With Destn .Value = pit.Name With .Font .Name = "Calibri" .Size = 11 .Underline = xlUnderlineStyleSingle .Bold = True End With End With Set Destn = Destn.Offset(2) pf.ClearAllFilters 'added this line (makes it a bit more robust). pf.CurrentPage = pit.Name With .TableRange1 .Copy Destn.PasteSpecial Paste:=xlPasteValuesAndNumberFormats Application.CutCopyMode = False Set myTable = Sheets("Sheet6").ListObjects.Add(xlSrcRange, Destn.Resize(.Rows.Count, .Columns.Count), , xlYes) myTable.TableStyle = "TableStyleMedium14" myTable.ShowTableStyleRowStripes = False Set Destn = Destn.Offset(.Rows.Count + 2) End With '.TableRange1 myTable.Unlist Next pit End With 'PT End Sub
You're getting paid for using my code, I'm not. I'm not going to spoonfeed you.





Reply With Quote
