pivot tables name
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and Help » Pivot Tables Name

Pivot Tables Name

The UK's most regular instructor-led training courses.
Training information: excel vba courses · Excel courses london · VBA courses London

resolvedResolved · Low Priority · Version 2003

Pivot Tables Name

Rebecca has attended:
Excel Advanced course

by - delegate Rebecca [14 posts] (2008 Apr 15 Tue, 16:17) replyReply

Hi,

I am writing a code to create a pivot table. Part of the code is:

ActiveSheet.PivotTableWizard SourceType:=xlDatabase, _
SourceData:=DataRange, tabledestination:=Destination, tablename:="SupplierInfo"

Whenever I run the Macro and error occurs saying the Pivot Table field name is not valid and data must be organised as a list with labled columns. If Iam changing the name of the Pivottable field, I must type in a new name for the field.

What am I doing wrong?

Many thanks

Becky

Excel Intermediate 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2007 2008 Jul 8 Tue Bloomsbury 0 FULL    
2003/XP 2008 Jul 8 Tue Bayswater 1 book now £195 £205
2003/XP 2008 Jul 9 Wed Bloomsbury 3 book now £210 £215
2003/XP 2008 Jul 15 Tue Bloomsbury 3 book now £210 £215
2003/XP 2008 Jul 15 Tue Tooting 0 FULL    
2007 2008 Jul 16 Wed Bloomsbury 7 book now £202 £224
Full Schedule: See all 160 Excel Intermediate course dates.
Bookings currently available until 25th November 2009.

RE: Pivot Tables Name

by - trainer Carlos gold contributer[360 posts] (2008 Apr 29 Tue, 11:12) replyReply

Hi Becky

Without seeing how your data is set up from what you said above it seems that your DataRange is not picking up the full table including the column labels which are taken by the system and converted to the pivottable field names.

The example code below sets the DataRange as a table whose column labels start in cell A9 and the destination on another sheet.

You will notice you need to pick up in full the table that contains the data to be pivoted so that when you populate the pivot table the computer knows which fields to use.

Sub MyPivot()

Dim DataRange As Range
Dim Destination As Range
Dim PvtTable As PivotTable

Sheets(“Totals”).Select

Set DataRange = Range("A9",Range(“A9”).End(xlToRight).End(xlDown)
Set Destination = Sheets("Sales Summary").Range("A12")

ActiveSheet.PivotTableWizard SourceType:=xlDatabase, _
SourceData:=DataRange, TableDestination:=Destination, TableName :="SupplierInfo"

Application.CommandBars("PivotTable").Visible = False 'Hides toolbar
ActiveWorkbook.ShowPivotTableFieldList = False 'Hides Field List

Set PvtTable = Sheets("Sales Summary").PivotTables("SupplierInfo")

With PvtTable

.PivotFields(“Salesperson”).Orientation = xlPageField
.PivotFields(“Year”).Orientation = xlRowField
.PivotFields(“Make”).Orientation = xlColumnField
.PivotFields(“Selling Price”).Orientation = xlDataField
.PivotFields(“Selling Price”).Function = xlSum

End With

End Sub

Hope this helps

If you still have problems send your workbook to my attention to:

info AT microsofttraining.net

Regards

Carlos


Related articles

· An Introduction to Microsoft Excel: Top Features for the Excel Novice
· Prepare for your MOS Certification with MS Excel Courses
· Excel Course Tips and Tricks to Liven Up Your Excel Spreadsheets
· Reasons Why VBA for Excel Training Fails
· Take the Anxiety out of Domestic Finances with Microsoft Excel

Please browse our web site to find out more about
excel vba courses and other Microsoft training courses.

Excel tip:

Paste a web address into the hyperlink address field

If you copy a web address the only way to paste into the address field of the hyperlink box is to use CTRL + V. Right click paste does not work.

View all Excel hints and tips

Institute of IT Training - Accredited Training Provider Institute of IT Training - Accredited Training Provider Prodigy Platinum Learning Partner Microsoft Office Specialist Authorised Testing Centre

Microsoft Registered Partner
microsoft office
ms office project server

Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz