+ Reply to Thread
Results 1 to 11 of 11

VBA to Compile Data from One Sheet to Other Sheets

  1. #1
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    VBA to Compile Data from One Sheet to Other Sheets

    Dear All,

    I hoe you will be doing well.

    Please be kind to extend your Benevolence to assist me to achieve the task using excel VBA to sum data base on Product ID and display
    output in other sheet of the workbook.


    Product ID Product Name Sale Comments Stock Pay
    1 GEAR
    2 GEAR
    3 GEAR
    4 GEAR
    5 GEAR


    I have attached illustration and sample workbook for your kind reference.


    Note: Attachment is Neat and Clean, Feel free to open....


    Your swift reply would highly be appreciated.

    Best Regards,
    Attached Files Attached Files
    Last edited by nabsher1; 06-13-2023 at 05:19 AM.

  2. #2
    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,364

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Formula solution

    in "GEAR" C8

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Column A of "Data" is Date/Time so convert to DATE only
    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.

  3. #3
    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,364

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Thumbs up Re: VBA to Compile Data from One Sheet to Other Sheets

    Thank you @JohnTopley

    It perfectly serves for the required purpose and works like a magic...

    Thank you so much for your time and prompt support...Big time Appreciated!!!!!
    Last edited by nabsher1; 06-13-2023 at 01:30 PM.

  5. #5
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Dear Bro @JohnTopley,

    I am sorry to get back to you again.

    Actually, this project need to be run in office 2003. Your solution/Code works fine with Office 2010 and higher.

    But it gives error of SUMIFS in office 2003 as shown in the yellow highlighted area in attached screenshot/ code blow in red. coz it is not supported in office 2003

    For l = 1 To 3 ' Loop through Sale, Stock, Pay
    .Cells(srow + k - 1, ocol(l - 1)) = Application.SumIfs(dRng(l), _
    ws1.Range("B:B"), sh(i), _
    ws1.Range("C:C"), .Cells(srow + k - 1, "A"), _
    ws1.Range("A:A"), ">=" & sDate, _
    ws1.Range("A:A"), "<=" & WorksheetFunction.EoMonth(sDate, 0))

    Next l

    Please be kind to modify SUMIFS and replace it with something else to be worked in older versions using VBA.

    Attachment 832945

    Thank you!
    Last edited by nabsher1; 06-14-2023 at 02:19 AM.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,659

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Note that selecting Attachment 832945 results in the following: "Invalid Attachment specified. If you followed a valid link, please notify the administrator".
    That said if you want a version 2003 compatible substitute for the SUMIFS formula in post #2, try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Dear @JeteMc

    My request in the post is about VBA code not excel formula.... Could you be help to modify the following code to make it work in Excel VBA 2003.

    For l = 1 To 3 ' Loop through Sale, Stock, Pay
    .Cells(srow + k - 1, ocol(l - 1)) = Application.SumIfs(dRng(l), _
    ws1.Range("B:B"), sh(i), _
    ws1.Range("C:C"), .Cells(srow + k - 1, "A"), _
    ws1.Range("A:A"), ">=" & sDate, _
    ws1.Range("A:A"), "<=" & WorksheetFunction.EoMonth(sDate, 0))
    Next l


    Regards,

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: VBA to Compile Data from One Sheet to Other Sheets

    nabsher1,

    No need to prepare each Product sheet,
    Try the attached.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 06-14-2023 at 10:16 AM. Reason: typo

  9. #9
    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,364

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Please Login or Register  to view this content.
    Attached Files Attached Files

  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,364

    Re: VBA to Compile Data from One Sheet to Other Sheets

    A work-around BUT you really must upgrade Excel and get rid of 2003

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 06-16-2023 at 03:31 PM.

  11. #11
    Registered User
    Join Date
    02-23-2019
    Location
    Manama, Bahrain
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA to Compile Data from One Sheet to Other Sheets

    Dear Bro John,

    Thank you so much for your kindness and helping me out.

    Regards,
    Nabsher

+ 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: 5
    Last Post: 02-15-2023, 12:09 PM
  2. Replies: 6
    Last Post: 10-31-2019, 03:46 PM
  3. Replies: 6
    Last Post: 04-27-2016, 02:38 AM
  4. Compile data from lots of sheets into one summary sheet
    By tkensen89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2015, 12:08 AM
  5. Looking to compile data from daily sheets onto 1 master sheet
    By coreygesell in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-17-2012, 03:08 PM
  6. Need to Compile Data from Multiple Sheets to a new Summary Sheet
    By achandra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2012, 01:15 PM
  7. Need Help: Compile Data from Multiple Sheets into New Sheet
    By amroberts2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2012, 02:55 PM

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