Dragging multiple columns at a time in Pivot Wizard?

seena

New Member
Joined
Nov 9, 2009
Messages
2
Is there any easier way to drag multiple columns at one time. For Ex. If I have 5 years of data by month and If I had to drag 2 years of data I would have to drag 24 times. Is there any easy way to drag all 24 months in 1 go ? Sorry I did not add that this is while using the Pivot Wizard to create a pivot table.
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to the Board!

I do not know of any way to drag multiple rows, but that process of creating a pivot table can be automated. Turn on the macro recorder and establish a pivot table. Code similar to the following will be created. You can edit it to perform similar tasks in the future.

Code:
    'Create the Pivot Table
    ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
        "Sheet1!R1C1:R40C27").CreatePivotTable TableDestination:="", TableName:= _
        "PivotTable1", DefaultVersion:=xlPivotTableVersion10
    ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
    ActiveSheet.Cells(3, 1).Select
 
    'Set up columns
    With ActiveSheet.PivotTables(1).PivotFields("1/1/2006")
        .Orientation = xlColumnField
        .Position = 1
    End With
    With ActiveSheet.PivotTables(1).PivotFields("2/1/2006")
        .Orientation = xlColumnField
        .Position = 2
    End With
    With ActiveSheet.PivotTables(1).PivotFields("3/1/2006")
        .Orientation = xlColumnField
        .Position = 3
    End With
    With ActiveSheet.PivotTables(1).PivotFields("4/1/2006")
        .Orientation = xlColumnField
        .Position = 4
    End With
 
    'Hide the field list
    ActiveWorkbook.ShowPivotTableFieldList = False
 
Upvote 0
Wonderful, this is a work around but it works and will same time for future runs. Many Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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