Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2003, 03:49 AM
Authorized User
 
Join Date: Jun 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy a pivot table fo a new sheet for formatting

Hi,

I am running a access 97 database to create a pivot form based on a table. What I would like to do is format the headings of the Pivot Form and apply some bolding to the text etc. Is this at all possible from VBA??? I think I would need to copy the form into a new sheet but dont now how!!!

Many thanks

Tim

Tim
__________________
Tim
 
Old February 2nd, 2005, 12:21 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is this an Excel Question? It sounds like you ought to post this in the access vba forum.

Cheers

Matthew

 
Old February 12th, 2005, 06:11 PM
bml bml is offline
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can modify various parts of the pivot by selecting the part you want to format and then changing the settings for the portion selected.

Search VB Help for pivotselect

Some sample code:

    ActiveSheet.PivotTables("PivotTable1").PivotSelect "NAME[All]", _
        xlLabelOnly
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Bold"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With

This code would bold the labels for the pivot object NAME

For an easy way to determine the required code, record a macro, do what you want
done, and then look at the macro to see what the code looks like.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Workbook,Copy Sheet,Move Sheet, Close/Save ptrussell2009 Excel VBA 0 June 13th, 2008 02:28 PM
dts - formatting excel sheet using activex script Najmunnisha SQL Server DTS 2 May 17th, 2007 10:27 PM
Copy specific data from one sheet to another yogeshyl Excel VBA 2 May 11th, 2007 09:14 AM
Copy one sheet to another file shamigc Excel VBA 2 April 13th, 2005 06:45 AM
Marcro to copy data from one sheet to another Crupa Excel VBA 1 November 24th, 2004 04:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.