Results 1 to 2 of 2
  1. #1
    Tomlon is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    7

    Access VBA Excel Pivot Table Formatting

    I have already gotten some valuable help with this and I want to say thanks so far. Also, I would like to say thanks for this as well. Background. I have VBA in Access 2010 that exports queries to an Excel workbook (for this exercise, lets say c:\output\temp.xlsb). It is just a temp excel sheet. After the queries are exported, I have code (still from Access) that will create a workbook and create various pivot tables on seperate worksheets. For instance, these pivot tables are very similar. One is a Ship To Report with Lbs. The other is a ship report with dollars. The layout will be listed below:



    File: c:\output\fab.xlsb

    Worksheet - Ship$
    Worksheet - ShipLbs

    The format of the pivot tables are as follows (Both worksheets / pivot tables have same layout)

    Row Headers are CustName then by ShipToName, Then by Prod.
    The column headers are by Year, Quarter, and Month
    The value is Amount

    What I need is how to apply formatting to this workbook. I would like The following:

    Font should be set to Arial size 8 for entire pivot table.
    I want the rows above the month (column) header to be frozen
    I want the columns to the left of Product to be frozen
    I want the Sold To Fields to be Bold.
    I want alternating rows (begining with first sold to) to be highlighted gray then white
    I want the value / Subtotal for the Quarter Column Bolded.

    As I will have various versions of Excel (some 2007 and some 2010), I am assuming late binding would be preferred. Any guidance in this would be appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Suggest you use the Excel macro recorder to generate code then modify it to work in Access. That's what I always do for new Excel code. When you have some code that can be analyzed, post it for review.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access 2010 VBA Creating Pivot Table in Excel
    By Tomlon in forum Programming
    Replies: 1
    Last Post: 02-07-2013, 02:25 PM
  2. Export to Excel from Pivot Table in Access 2010
    By nicon2k in forum Import/Export Data
    Replies: 0
    Last Post: 04-10-2012, 07:02 AM
  3. Pivot table - access to excel
    By antagonia in forum Access
    Replies: 3
    Last Post: 12-16-2011, 01:57 PM
  4. Pivot Table from Excel Spreadsheet
    By Cgil32 in forum Access
    Replies: 0
    Last Post: 08-26-2010, 05:18 PM
  5. Export Access Pivot Table to Excel
    By graviz in forum Programming
    Replies: 1
    Last Post: 11-13-2009, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums