+ Reply to Thread
Results 1 to 7 of 7

Selecting columns for pivot table

Hybrid View

  1. #1
    Registered User
    Join Date
    07-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Selecting columns for pivot table

    I am trying to create a pivot table from data I have in one sheet however I only need certain columns of the data. For example below I have 4 columns of data however I only want to have the data for columns "Date", "Country" and "Passengers" in my pivot table field list:

    Date Country House No. Passengers
    01-Jan-09 Japan 15 10
    02-Jan-09 Guildford 1 11
    03-Jan-09 Hever 89 12
    04-Jan-09 Japan 18 13
    01-Jan-09 Guildford 26 14


    Any ideas?



    --
    James.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Selecting columns for pivot table

    Just use the entire table of data. You can configure the Pivot Table to use only the fields that are needed. Fields in the Pivot Table do not automatically display or calculate until you perform an action on them.

  3. #3
    Registered User
    Join Date
    07-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Selecting columns for pivot table

    Hi Palmetto

    Thank you very much for getting back to me. The problem I will have though is that all the columns will show in my pivot table field list i.e. be available as options to select from which I don't want them to be. Does this make sense?

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Selecting columns for pivot table

    OK. I see what you mean now.
    There is no way that I am aware of to hide items in the field list. I think you will have to work with a subset of the data that excludes the columns you dont want them to access.

    But this may not be feasible if those columns contain data needed for calculations in the the Pivot Table.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Selecting columns for pivot table

    Once the PT is setup you can apply code such that the Field List is Disabled when PT first updated (refreshed etc...) - the same can be done with the PT Wizard which pre-07 could be used to alter the layout also, eg:

    Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
    Application.EnableEvents = False
    With Target
        .EnableFieldList = False
        .EnableWizard = False
    End With
    Application.EnableEvents = True
    End Sub
    Not sure if this is what you want or not... obviously you could add Admin functionality such that Boolean Enabled status is dependent say upon Environ("username") being = to your own credentials (ie if you (true) then features enabled else (False) they are disabled)

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: Selecting columns for pivot table

    To do it simply, you would just need to rearrange the data so that the 4 columns make up a contiguous range of data.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    07-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Selecting columns for pivot table

    Hi all

    Thanks for the responses.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1