+ Reply to Thread
Results 1 to 5 of 5

Better way to transfer data my way taking a long time

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2007
    Posts
    2,518

    Better way to transfer data my way taking a long time

    Hi,

    I have this file. In this file are basically two sheets i am using.

    One of the sheets has recipes on it. I onlyl show a few recipes but there are hundreds. The other sheet is the "output" sheet and basically i am taking the recipes from one page and putting them on the other horizontally. But note......not all the ingredients in each recipe is teh same so i can just cut-n-paste.

    Right now what i do is compare each ingredient from each recipe to the first row on the output page. If i dont find the ingredient then i add it. I also have to add the amount of each ingredient . You can look at my way in the code of the attached macro..........see the subroutine "put_ingredients" this takes a really long time and i am only putting "one" recipes ingredients cant imagine once i have hundreds...........

    anyone know a better way?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2007
    Posts
    2,518

    Re: Better way to transfer data my way taking a long time

    forgot to add something to the output sheet......
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2007
    Posts
    2,518

    Re: Better way to transfer data my way taking a long time

    it should run now......
    Attached Files Attached Files

  4. #4
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Better way to transfer data my way taking a long time

    Hi welchs101

    The attached contains over 1500 recipes and takes less than 5 seconds to complete (granted...they're the same recipes and don't have 500 ingredients).

    I've not modified your code significantly...commented out some lines that made no sense to me...added a few lines to give functionality I thought was necessary.

    You've got a bunch of Functions going ...don't know if more direct methods would be better or not...just don't know.

    Anyway...on my platform with 1500 plus recipes this is not an issue
    the subroutine "put_ingredients" this takes a really long time
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2007
    Posts
    2,518

    Re: Better way to transfer data my way taking a long time

    thanks! i have not had time to look at the code to see whatyou did yet but i will try and get to it today after work. thanks again i really appreciate it!!!!!!!!!!!!!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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