+ Reply to Thread
Results 1 to 16 of 16

need a macro or formula for consolidation of data

  1. #1
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    need a macro or formula for consolidation of data

    i have a table updated on every month by user

    see attcahed for reference.
    Column A and B remains the same in the template and the
    user updates only the range from column C to column G on monthly basis

    before updating, user copies the last month data and pastes to adjacent columns from column J
    (example if feb month data is processed, Jan month data is taken a copy and pasted in column J and this is a continuous process on monthly basis.

    I need a macro to see a consolidated data based on history dates ..refer output sample sheet in attached xls.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    Does sheet "output sample" already exists ?
    In others words, the macro just need to copy new data from sheet "input" and past it in sheet "output sample" and filter it ?
    Note : in sheet "output sample" there is only Apple you need others fruits , or how do we filter the data ,
    Last edited by PCI; 02-22-2020 at 04:26 PM.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    Here a first draft
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need a macro or formula for consolidation of data

    your code shows a run time error at
    Set Wkrg = Range(.Cells(Rows.Count, LC).End(3)(2), .Cells(Rows.Count, LC - 1).End(3).Offset(0, 1))


    in output sample i mentioned only "Apples" with consolidated history data with month name - "H" column

    same way i need macro for all the product consolidation with month ... please help

  5. #5
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need a macro or formula for consolidation of data

    note J2 to BQ5 range has only apple product history dates.. it is consolidated in output sample. same way .. all the product has to be consolidated with month name

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    See test file attached, try and comment
    I have the feeling that sheets' names are not the same..!
    Attached Files Attached Files
    Last edited by PCI; 02-22-2020 at 04:53 PM.

  7. #7
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need a macro or formula for consolidation of data

    is any other way to do it?

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    is any other way to do it?
    What dio mean ??
    Is it not working properly ?

  9. #9
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need a macro or formula for consolidation of data

    your code shows a run time error at
    Set Wkrg = Range(.Cells(Rows.Count, LC).End(3)(2), .Cells(Rows.Count, LC - 1).End(3).Offset(0, 1))


    in output sample i mentioned only "Apples" with consolidated history data with month name - "H" column

    note J2 to BQ5 range has only apple product history dates.. it is consolidated in output sample. same way .. all the product has to be consolidated with month name

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    your code shows a run time error at
    Set Wkrg = Range(.Cells(Rows.Count, LC).End(3)(2), .Cells(Rows.Count, LC - 1).End(3).Offset(0, 1))
    Not in the file sent ...is not it ? rockymp_sample data.xlsm
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    note J2 to BQ5 range has only apple product history dates.. it is consolidated in output sample. same way .. all the product has to be consolidated with month name
    All products are present in the file sent, is it ?

  12. #12
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need a macro or formula for consolidation of data

    Hi Your code picks only feb 2020 consolidation... is either way to consolidate all months data.. i mean feb 2020 till jun 2019.. )data in range till BQ 53 in input?

  13. #13
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    Hi Your code picks only feb 2020 consolidation... is either way to consolidate all months data.. i mean feb 2020 till jun 2019.. )data in range till BQ 53 in input?
    So it is not the same data and you did not answer my first question.
    What is the data to use ?? Today data from columns A to G is used and the date added is the date of today ...!

    It seems you want to rebuilt the complete data set each month ...? It means sheet "output sample" has to be cleaned up each time !!!
    You could just add the new data from column A to G

  14. #14
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    Folowing my last questions and comments here another possiblity
    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    02-22-2020
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need a macro or formula for consolidation of data

    This is what i needed. thanks a Ton.. you are a Champ.

  16. #16
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: need a macro or formula for consolidation of data

    You're welcome, it tooks time to understand the specifications ...!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] 2 macro for unique items from a database to unique data sheet consolidation
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2017, 11:25 AM
  2. [SOLVED] Consolidation several tabs' data into a consolidation sheet via a loop?
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-30-2015, 08:18 AM
  3. Data consolidation - Macro/Script
    By N8237 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2015, 06:47 PM
  4. [SOLVED] Data Consolidation with Macro's
    By marcusduton in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2015, 02:11 AM
  5. [SOLVED] Consolidation Report - Existing Formula Not Capturing All The Data
    By DDM64 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-27-2013, 10:00 AM
  6. data consolidation macro help
    By SANAGO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2010, 07:27 AM
  7. A macro for data consolidation
    By SR in forum Excel General
    Replies: 6
    Last Post: 07-13-2006, 11:25 AM

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