+ Reply to Thread
Results 1 to 28 of 28

Populate report from date to date for many ID

  1. #1
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Populate report from date to date for many ID

    Hello
    I search for macro to deal for each sheet .
    in two sheets I have data for items in columns D:F and the price in column H . so what I want when merge duplicates items based on matching columns D: F and when repeat the same item with different price should use price averages but when merge items should be separated for each sheet alone , also when merge quantity should just be for SVR sheet (means ignoring QTY totally in SR sheet when merge as I did last sheet .
    when merge data should be based on two cells (dates) should merge within two dates in E2,G2 . if the E2,G2 are empty then should be empty from row 5 .every time run the macro should clear data from row5 before brings the data without delete formatting and borders , not repeat to the bottom the same data have already copied.
    in REPORT sheet SVR header is averages prices from column H for SVR sheet ,SR header is averages prices from column H for SR sheet and in last row(TOTAL) should sum the columns I,J,K and in column L will subtract and sum for I:K as I put the formulas .
    if they data are existed in SVR but not in SR should show in REPORT sheet , but if they data are existed in SR ,not in SVR should NOT show in REPORT sheet .
    finally when copy data to report sheet I want keep the formatting (numbers,borders....) .
    thanks
    Attached Files Attached Files
    Last edited by abdo meghari; 12-06-2023 at 08:43 AM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    Hey there abdo...
    The date population part I do not understand...
    This renders your expected result though...
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    Hi sintek
    The date population part I do not understand...
    I want creating report based on two dates . should not merge for all ID without depend on two dates .
    just merge based what data start and end date also between two dates and ignore merging before start date and after end date and when dates cells are empty then should not show anything
    edited file to understand how could be
    Last edited by abdo meghari; 12-06-2023 at 06:17 AM.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    Yet you do not provide the between dates?

  5. #5
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    Yet you do not provide the between dates?
    sorry !
    would you see edited file,please?

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    Need an entire different code approach for this...Will revert back a bit later...Off to work now...

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    Based on these dates, your output result is incorrect...
    Last edited by sintek; 12-06-2023 at 06:57 AM.

  8. #8
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    Based on these dates, your output result is incorrect...
    OMG!
    sorry again I was hurry .
    it's corrected.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    And another error...see green value below...

    Untitled.png
    Attached Files Attached Files
    Last edited by sintek; 12-06-2023 at 07:07 AM.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  11. #11
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    And another error...see green value below...
    understood , sorry again !
    as to your new version seem this is what I want , but I need some time to make sure .
    I will inform you today .

  12. #12
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    Hi JohnTopley ,
    thanks but I note your code showing new ID in SR sheet but is not existed in SVR sheet also when the ID is not existed in SVR sheet within date I note showing .
    the highlighted rows shouldn't show based on dates.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    See attached

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 12-06-2023 at 04:18 PM.

  14. #14
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    Thanks sintek & john !
    just remains one thing : if the E2,G2 are empty then should be empty from row 5 . as I mentioned in OP.

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    Why would you run macro with these fields empty ?

    Please Login or Register  to view this content.

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    Please Login or Register  to view this content.
    Last edited by sintek; 12-07-2023 at 01:33 AM.

  17. #17
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    thanks John , but after clear data when there is no date and try write dates again to populate data will shows application defined error in this line
    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    thanks sintek , but but after clear data when there is no date and try writing dates again , then it doesn't show data. the cells keep empty from row 5!

  19. #19
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    I don't have any problem deleting the dates and then adding dates again!

    You will get an error if there is no data in the dates used.

    Add highlighted line

    Please Login or Register  to view this content.
    Last edited by JohnTopley; 12-07-2023 at 03:43 AM.

  20. #20
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    You will get an error if there is no data in the dates used.
    umm, thanks for your notice , but your suggestion will cancel option in post #15

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    No it does not: if you do not enter dates it will clear the data but if you enter dates for which there is no results then the added test will/should prevent the error.

    I am out!

  22. #22
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    you can test it yourself .
    Attached Files Attached Files

  23. #23
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    Wrong (not updated) macro: see post #15.

  24. #24
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    Please Login or Register  to view this content.
    is that wrong place?

  25. #25
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,422

    Re: Populate report from date to date for many ID

    YES:

    Please Login or Register  to view this content.

  26. #26
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    thank you so much John

  27. #27
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Populate report from date to date for many ID

    oops...my bad...
    Please Login or Register  to view this content.

  28. #28
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Asia
    MS-Off Ver
    2010 & 2016 insider(Windows 10 64-bit)
    Posts
    732

    Re: Populate report from date to date for many ID

    oops...my bad...
    no problem
    thank you so much for correction .

+ 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. Replies: 9
    Last Post: 06-11-2018, 07:17 AM
  2. [SOLVED] Date conversion - Excel presents system report date incorrectly
    By Fred Johs in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-02-2017, 10:26 AM
  3. Replies: 0
    Last Post: 01-30-2016, 11:49 AM
  4. Replies: 6
    Last Post: 04-20-2015, 09:40 AM
  5. Replies: 1
    Last Post: 05-26-2014, 03:46 AM
  6. Replies: 4
    Last Post: 04-24-2014, 04:34 AM
  7. Replies: 2
    Last Post: 06-25-2010, 09:19 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