none
Which is best approach to read selective data from other workbook using vba code RRS feed

  • Question

  • I have Master Excel Template which having pivot table in particular sheet. Now I want to the open the Configuation excel file to read the subtotal criteria for pivot table by passing particular dept no. Update fetched subtotal criteria in pivot table using vba code.

    I want to know which is best approach to read the configuration excel file to fetch subtotal criteria for pivot table by passing particular dept no.

    Approach 1

    Open configuration excel file and store all subtotal criteria in array and close the configuration excel file. Later loop the array to fetch particular dept no. subtotal criteria for pivot table.

    Approach 2

    Open configuration excel file and apply autofilter by passing particular dept no. then fetch subtotal criteria for pivot table from second row. Close the configuration excel file after completing all process.

    Approach 3

    Open configuration excel file and store all subtotal criteria in collection and close the configuration excel file. Later fetch subtotal criteria  value from collection by passing key value of particular dept no. 

    Approach 4

    Open configuration excel file and copy the sheet to master template then close the configuration excel file. Then read all subtotal criteria from copied sheet and store it in array. Later loop the array to fetch particular dept no. subtotal criteria for pivot table.


    Bala


    • Edited by Balaramji Monday, June 6, 2016 3:20 PM
    Monday, June 6, 2016 3:16 PM