pivot tables

baggarwal

Well-known Member
Joined
Jul 10, 2002
Messages
591
Hi All:

I have a dilemna I need your guidance on. When I use Excel XP for pivot tables I get the option of "Add to" when I click finish. This Add to function allows me to add to columns and rows.

The only problem is when I try to create pivot tables in Excel 2000 it doesn't have that feature.

How can I add this feature to Excel 2000, or is there another way of adding to rows and columns using some menu.

Thanks in advance for your help,

BA
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
baggarwal- quick clarification question. how is your source data formatted?

anthony

ps. what I mean is, what is the structure of your source data list.
This message was edited by attc on 2002-10-26 12:55
 
Upvote 0
Hi Anthony:

Here is how the source data is structured:
SAP_Download_coding2.xls
ABCDEFGHI
5OrderCostElementDescriptionBudget/ActualAprMayJunJulAug
67000275133000COS:contractcleanBudget2702702701670270
77000275133000COS:contractcleanActual151004174171217
87000275133300COS:kaizenimplemeBudget00000
97000275133300COS:kaizenimplemeActual4170000
107000285133000COS:contractcleanBudget540540540540540
117000285133000COS:contractcleanActual00417417417
127000285133300COS:kaizenimplemeBudget00000
137000285133300COS:kaizenimplemeActual4170000
DesiredResult


Thanks again for your help,

BA
 
Upvote 0
Is there another feature other than pivot tables that would allow me to achieve what I am looking for?
 
Upvote 0
hi Baggarwal,

Yeh, the problem you are having is partly because of the structure of the data. (Not that the structure is bad, it's just difficult for the pivot table to interpret correctly. Seems they corrected this in Excel XP).

One way to overcome this is to convert the data (either manually or via macro) into the format:

Col A: Order
Col B: Cost Element
Col C: Description
Col D: Budget / Actual
Col E: Month
Col F: Amount

When you have in this format, the pivot table will work beautifully.

I'm not sure of any other way?
 
Upvote 0
I am not very familiar with VBA.

Is there anyone out there that can show me how to build a macro that will take data in multiple columns (as above) and put it into one column.

Thanks again for all of your help,

Bharat
 
Upvote 0
This is a very similar problem to one I've had before, so rather than try to explain, I've modified my existing code for you. Try this out:


Sub JustDoIt()
'

Cells.Copy

Set outputW = Workbooks.Add
Selection.PasteSpecial xlValues

Set dataS = ActiveSheet

Range("A1:D1").Copy

Set outputS = Worksheets.Add
Selection.PasteSpecial xlValues
Range("E1").Value = "Month"
Range("F1").Value = "Amoutn"

Range("A2").Select

dataS.Select

Set basedata = Range(Range("A2"), Range("D65536").End(xlUp))

Let RecordCount = basedata.Rows.Count
Let monthscount = Range(Range("E1"), Range("E1").End(xlToRight)).Columns.Count

For A = 1 To monthscount

dataS.Select
Let M = Cells(1, A + 4).Value

basedata.Select
Selection.Copy

outputS.Select

Cells((A - 1) * RecordCount + 2, 1).Select

Selection.PasteSpecial xlValues
Selection.Offset(0, 4).Resize(, 1).Select
Selection.FormulaR1C1 = M

Selection.Offset(0, 1).Select
basedata.Offset(0, A + 3).Resize(, 1).Copy Selection

Next

End Sub


Assumptions and Caveats:
(i) probably not the most elegant code! but it works for me and fast enough

(ii) the source data is structured:
col A: Order
col B: Cost Element
col C: Description
col D: Budget / Actual
col E onwards: different months

data is contiguous

(iii) the macro is run from the source data sheet as it just starts copying immediately
This message was edited by attc on 2002-10-27 08:39
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,665
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top