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
|