+ Reply to Thread
Results 1 to 6 of 6

Is it possible to use data validation lists to create pivot tables in VBA?

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Brawley, California
    MS-Off Ver
    Excel 2010, 2007
    Posts
    11

    Is it possible to use data validation lists to create pivot tables in VBA?

    I have created a page that calls data from a spreadsheet, but I only want certain rows with specific choice criteria. The criteria would be in a drop down list from a data validation, and the list referencing a row in the spreadsheet (see attachment). Is this done with VLookUp or Pivot tables or even a combination? There are two pages included (but 100s more exist) where the data would come from.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Is it possible to use data validation lists to create pivot tables in VBA?

    try this, in sheet1 C15, copied down
    =OFFSET(INDIRECT("'"&LEFT($D$12,5)&"'!$A$1"),3,ROW(A1))

    then in D15, copied down and across
    =INDEX(INDIRECT("'"&LEFT($D$12,5)&"'!$A$1:$CD$46"),MATCH("mg/kg "&D$14,'SP024'!$A$1:$A$46,0),ROW(A2))

    let me know how you make out
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    Brawley, California
    MS-Off Ver
    Excel 2010, 2007
    Posts
    11

    Re: Is it possible to use data validation lists to create pivot tables in VBA?

    FDibbins,

    You da man! This will work once I have a good handle on the proper use of indirect referencing and the application of the offset function. Is there a dictionary of functions used in VBA that you recommend? Consider this thread answered in high regards!

    Again thanks to all who have helped and to FDibbins for an excellent response! BAT:-)

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Is it possible to use data validation lists to create pivot tables in VBA?

    you are welcome, and thanks for all the kind words and rep, we all appreciate them

    i have workbook at work (at home atm) that i will send you with most of the formulas in them, but i made that up from the excel help file anyway. do a search for "functions" in the excel help

  5. #5
    Registered User
    Join Date
    10-15-2012
    Location
    Brawley, California
    MS-Off Ver
    Excel 2010, 2007
    Posts
    11

    Re: Is it possible to use data validation lists to create pivot tables in VBA?

    Danka! Just what I need. I have tons of VBA books, but nothing beats the personal touch.

    Thank you again, BAT:-)

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Is it possible to use data validation lists to create pivot tables in VBA?

    take a look through the attached, hope it helps
    Attached Files Attached Files

+ 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