Wrox Programmer Forums
|
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 November 18th, 2003, 05:11 AM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default excel 97 & pivottable

Hi There
I have a couple of problems working with with Excel 97 & pivottables.

1). I am trying to rename a couple of datafields where Excel is creating field names such as 'Sum of Breach' & 'Count of Call_Ref' I wish to rename them. I have tried code such as
Set myField = myPivot.PivotFields("Breach")
then myfield.name = "NewName" but the value appears to be read-only.

2). I am trying to create a Calculatedfield using code such as
Set slafield = myPivot.CalculatedFields.Add("SLA", "(=x)"). I can find little or no info on how to set the formula part of the Calculated field.

Any help would be appreciated

 
Old November 18th, 2003, 08:44 AM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well my problem now boils down to summing 2 calculatedfields.
I have field1 which is a count of one set of values, field2 which is a sum of another field now I wish to create a new calculatedfield which manipulates field1 and Field2 ie :-

Set slafield = myPivot.CalculatedFields.Add("SLA", "=(Field1 + Field2)")

But it doesn't appear that you can do this with calculated fields, has anybody any idea how I can do this ??








Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect / Unprotect Excel 97 - VBA Code - jlpazv Excel VBA 2 November 30th, 2007 10:54 AM
Using Excel XP and Excel 97 chiefouko Beginning VB 6 9 March 30th, 2007 03:32 AM
Excel 2002 Sp1 & Excel Sp2 anup.bihani Excel VBA 0 November 23rd, 2006 04:48 AM
Return Data from Excel 97 Range into table interrupt Javascript How-To 3 March 4th, 2005 07:14 AM
Using Excel XP and Excel 97 chiefouko Excel VBA 3 August 27th, 2003 03:24 PM





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