Introduction E xcel’s pivot tables are a powerful tool for analyzing data. With only a few minutes of work, a new user can create an attractively formatted table that summarizes thousands of rows of data. This book assumes that you know the basics of Excel and pivot tables, and provides troubleshooting tips and techniques, as well as programming examples. Who This Book Is For This book is for anyone who uses pivot tables, and who reads the manual only when all else fails. It’s designed to help you understand the advanced features and options that are available, as you need them. Experiment with pivot tables, and if you get stuck, search for the problem in this book. With luck, you’ll find a solution, a workaround, or, occasionally, confirmation that pivot tables can’t do what you want them to do. How This Book Is Structured Chapters 1 to 12 contain manual solutions to common pivot table problems, and alert you to the situations where no known solution exists. Chapter 13 has sample code for those who prefer a programming solution to their pivot table problems. The following is a brief summary of the material contained in each chapter. • Chapter 1, “Creating a Pivot Table”: Topics include issues you should consider when planning a pivot table and preparing the source data; problems that occur when connecting to the source data; and understanding the pivot table options that are available. • Chapter 2, “Sorting and Grouping Pivot Table Data”: You’ll learn how data sorts in a pivot table, as well as how to create custom sort orders, show top items only, and group and ungroup numbers, dates, and text. • Chapter 3, “Calculations in a Pivot Table”: This chapter discusses using the sum- mary functions and custom calculations, creating calculated items and calculated fields to expand the built-in capabilities, modifying formulas, and adjusting the solve order. xxi 6293ch00FM.qxd 2/1/06 5:46 PM Page xxi • Chapter 4, “Formatting a Pivot Table”: You’ll learn about autoformatting a pivot table, applying and retaining formatting, creating custom number formats, and showing and hiding totals and subtotals. • Chapter 5, “Extracting Pivot Table Data”: Topics include using the Drill to Details feature to extract underlying records, using the GetPivotData worksheet function to return pivot table data, turning off the GetPivotData feature, and creating pivot table copies with the Show Pages feature. • Chapter 6, “Modifying a Pivot Table”: This chapter covers changing the pivot table layout, modifying field and item captions, clearing old items from the field drop- downs, adding comments to data cells, and customizing the PivotTable toolbar. • Chapter 7, “Updating a Pivot Table”: Topics include refreshing the pivot table, refreshing automatically, reconnecting to the source data, changing the source data, and creating a dynamic source data range. • Chapter 8, “Securing a Pivot Table”: This chapter discusses preventing users from changing the pivot table layout, connecting to a password-protected data source, using security features, and addressing privacy issues. • Chapter 9, “Pivot Table Limits and Performance”: This chapter covers understanding limits to pivot table field size, addressing memory issues, maximizing performance, and reducing file size. • Chapter 10, “Publishing a Pivot Table”: This chapter explains how to prepare a pivot table for publishing on a web page, with or without interactivity. • Chapter 11, “Printing a Pivot Table”: Topics include printing headings on every page, repeating row and column labels, adjusting the print area, and using the Report Manager to simplify printing. • Chapter 12, “Pivot Charts”: This chapter covers restoring lost formatting, creating normal charts from pivot tables, stepping through the Chart Wizard when creat- ing a pivot chart, and modifying a pivot chart layout. • Chapter 13, “Programming a Pivot Table”: You’ll learn how to record and use macros, and edit recorded code. This chapter includes sample code for modifying and printing pivot tables and clearing old items from pivot field dropdown lists, and it discusses refreshing pivot tables on protected sheets, preventing layout changes, reformatting a pivot chart, and changing the pivot cache. ■ INTRODUCTIONxxii 6293ch00FM.qxd 2/1/06 5:46 PM Page xxii Prerequisites The solutions in this book are written for Microsoft Excel 2003. Most will work in Excel 2002, but may not adapt to earlier versions. A working knowledge of Excel is assumed, as well as familiarity with pivot table basics. Sample code is provided in Chapter 13, and some programming experience may be required to adjust the code to conform to your workbook setup. For an introduction to pivot tables, see A Complete Guide to PivotTables: A Visual Approach, by Paul Cornell (Apress, 2005). Downloading the Code Sample workbooks and code are available for download from the Apress website. Contacting the Author The author can be contacted at ddalgleish@contextures.com. Visit her Contextures web- site at www.contextures.com. ■ CONTENTS xxiii 6293ch00FM.qxd 2/1/06 5:46 PM Page xxiii . pivot cache. ■ INTRODUCTIONxxii 6293ch00FM.qxd 2/1/06 5:46 PM Page xxii Prerequisites The solutions in this book are written for Microsoft Excel 2003. Most. adjust the code to conform to your workbook setup. For an introduction to pivot tables, see A Complete Guide to PivotTables: A Visual Approach, by Paul