+ Reply to Thread
Results 1 to 20 of 20

Sum items before transfer process

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Sum items before transfer process

    Hello everyone
    I have working code that transfers data to different sheets and it is working very well
    Please Login or Register  to view this content.
    I need to modify this code so as to be able sum the similar items before transfer process
    That is if you execute the code now it will transfer all items ..for example: store1 will have five items after running the code
    There are similar items in the five items so I need the expected results to have only for stor1 (3 results looks like that)
    1- Item2 35 Store1
    2- Item9 25 Store1
    3- Item22 44 Store1

    Thanks advanced for help
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    And then what should happen to the serial number when 2 entries are merged?
    Cheers!
    Deep Dave

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Thanks for reply
    As for serial number it would be 1,2,3,4 and so on regardless the source field ..

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    Here!

    Call this procedure after your existing procedure before the end sub statement

    Please Login or Register  to view this content.
    Last edited by NeedForExcel; 03-30-2016 at 07:52 AM.

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Thanks a lot for this great help
    In fact I don't need to use nested loops as it is very slow with original data .. so I was searching for a way to edit the existing code itself if possible
    But your solution is working very well for the sample

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Is it possible to edit the original code itself?

  7. #7
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    Alright! Give me some time, I will check it out..

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Thanks a lot for quick reply
    Take your time .. I am not in hurry .. I could wait for days

  9. #9
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    How about automating your existing code with an additional Subtotal feature to get the subtotal based on Items. Are you fine with Subtotal?

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    You mean to add helper column for doing that .. In fact I don't need to add any helper columns if possible

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    I am still waiting .. Is it possible to edit the original code ?
    If not can it be done from the start again but using arrays as the data is large

  12. #12
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    I am sorry.. It kind of slipped my mind.. I will start working on the code right away.. Sorry!

  13. #13
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    Give this a try

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    This is using arrays.. Should be faster..

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

    Re: Sum items before transfer process

    Please Login or Register  to view this content.

  15. #15
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Awesome and fascinating
    That's incredible ..
    It worked like charm ...
    Thank you very much for help

    Just last request if your time allows
    Need to format the output as main sheet ("DATA") ..
    Thanks a lot for this great help

  16. #16
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Thank you very much Mr. Jindon
    I don't need the results in a message box .. I need to put results in related sheets ..
    Store1 results in Sheets("Store1")
    Store2 results in Sheets("Store2")
    and so on ..
    Thanks advanced

  17. #17
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    Just 1 thing..

    Change this line

    R(Counter, 1) = R(Counter, 1) & "," & R(Counter2, 1)

    to this line

    R(Counter, 1) = R(Counter, 1) & ", " & R(Counter2, 1)

    I have added a space after a comma.

    So the edited codes would be

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by NeedForExcel; 04-01-2016 at 01:30 AM.

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

    Re: Sum items before transfer process

    Much simpler
    Please Login or Register  to view this content.

  19. #19
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Sum items before transfer process

    @Jindon:

    That is an insanely fast code.. Great to learn from you always.. Cheers!!

  20. #20
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sum items before transfer process

    Thanks a lot for these great solutions . I will try to make use of these solutions ..
    Thank you very very much for help
    Best Regards

+ 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. Transfer random listbox items to new listbox and then loop through selected items
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2013, 05:58 PM
  2. Replies: 2
    Last Post: 12-21-2011, 02:54 AM
  3. Transfer Selected UserForm ListBox Items into a new Row
    By oumomof3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-25-2011, 02:02 PM
  4. Replies: 0
    Last Post: 06-21-2011, 10:40 PM
  5. Transfer Items from a Row into another Sheet.
    By stuartforrest in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-04-2011, 06:31 PM
  6. transfer items to another workbook
    By mhlangensiepen in forum Excel General
    Replies: 3
    Last Post: 11-13-2010, 05:49 AM
  7. listbox items transfer
    By cassiopea in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-23-2009, 05:28 AM
  8. [SOLVED] Transfer Items to a list with no duplicates
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-30-2005, 06:06 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