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 December 23rd, 2009, 10:26 AM
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to change pivot tables column label

i am just starting to learn excel vba so i am not sure what to do.
I have a pivot table that have the following data:
Time Key Value
12/21/2009 00:05:00 03057168 718
12/21/2009 00:05:00 03057169 283
12/21/2009 00:05:00 03057170 577
12/21/2009 00:05:00 03057171 -89
12/21/2009 00:05:00 03057172 -136
12/21/2009 00:05:00 03057173 -79

12/21/2009 00:10:00 03057168 694
12/21/2009 00:10:00 03057169 263
12/21/2009 00:10:00 03057170 544
12/21/2009 00:10:00 03057171 -89
12/21/2009 00:10:00 03057172 -141
12/21/2009 00:10:00 03057173 -85


This sequence repeats until all of the record have been read from my DB
The key can change depending on the site location that I am running query on

What I want to end up with is that data looking like the following

Row Headings:
date 03057168 03057169 03057170 03057171 03057172 03057173

Data for each column
12/21/2009 00:05:00 718 283 577 -89 -136 -79
12/21/2009 00:10:00 694 263 544 -89 -141 -85
12/21/2009 00:15:00 617 268 579 -95 -143 -83
12/21/2009 00:20:00 650 272 551 -101 -140 -85
12/21/2009 00:25:00 641 273 565 -97 -148 -86
12/21/2009 00:30:00 643 256 529 -105 -153 -91

All I want to do is to create a calculated formula that divides colums
D/A , E/B , F/C put these values in 3 new columns then make a pivot chart displays the 3 values
The actual key's may change but I do not need to worry about these just the actual values.

My Questions are:
1. Should a use a pivot table or the transpose function (not sure how to use the transpose function)
2. How do i refer (or rename) to the column label (03057168, 03057169, etc) so that i can perform the calculations base on the particular column value and not the labels. If i rename the column label (KWa, KWb, etc) when i do a refresh they get overwritten with the numbers.
3. How would I check to see how many rows exists to do calculations on

Not sure if this makes sense but please let me know if i need to provide additional information.

Thanks
RH





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA for Pivot Tables stealthdevil Excel VBA 3 March 21st, 2007 04:01 PM
how to work pivot tables malli_kv2 Access 1 March 16th, 2007 06:34 AM
Linking pivot tables iacon Excel VBA 3 July 24th, 2006 01:25 AM
International Pivot Tables noldrini Excel VBA 0 February 8th, 2006 12:54 PM
Pivot Tables smartgir Excel VBA 0 May 12th, 2004 10:08 AM





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