Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi ,
I want a macro for creating pivot table.However I get an error after a certain comand (indicated by------) Following is the set of commands I have typed - Sheets("Final Sheet").Select ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "'Final Sheet'!R1C1:R1567C43").CreatePivotTable TableDestination:="", _ TableName:="PivotTable2", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select With ActiveSheet.PivotTables("PivotTable2").PivotFields ("CODE") .Orientation = xlRowField .Position = 1 End With ActiveSheet.PivotTables("PivotTable2").AddDataFiel d ActiveSheet.PivotTables( _ "PivotTable2").PivotFields("Type"), "Count of Type", xlCount Range("A3").Select ActiveSheet.PivotTables("PivotTable2").PivotFields ("Count of Type"). _ Orientation = xlHidden With ActiveSheet.PivotTables("PivotTable2").PivotFields ("Type") .Orientation = xlColumnField .Position = 1 End With ActiveSheet.PivotTables("PivotTable2").AddDataFiel d ActiveSheet.PivotTables ("PivotTable2").PivotFields("CTRY"), "Count of CTRY", xlCount ---------------------- Sheets("Sheet1").Select Sheets("Sheet1").Name = "Pre Checks" Range("A5").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Sheets("CHECKS").Select Range("A2").Select ActiveSheet.Paste Can any one help me with this? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
link to combobox | Excel Discussion (Misc queries) | |||
copy excel cell to cell in word table using excel macro | Excel Discussion (Misc queries) | |||
why can't I setup a macro to run Pivot Table? | Excel Discussion (Misc queries) | |||
consolidation of tables in excel with text and figures | Excel Worksheet Functions | |||
Macro Help In Excel | Excel Discussion (Misc queries) |