+ Reply to Thread
Results 1 to 3 of 3

Help cleaning code, and dynamic arrays

  1. #1
    Registered User
    Join Date
    12-10-2015
    Location
    Aarhus, Denmark
    MS-Off Ver
    2016
    Posts
    22

    Help cleaning code, and dynamic arrays

    I am complete rookie to VBA, but i have been attempting to write a macro that can generate a list of productions ID's that are fit for production, based on two parameters. A production can only be initiated if it can be produced 100%, no split production is allowed, and the current stock of the part to be produced need to be less than 20% of a years sales.

    I have written the following code, which does do what i want it to, but i know it can be written smarter, and with dynamic arrays, cause i never know the excact amount of produciton orders to look through, and how many can be singled out for production.

    Please Login or Register  to view this content.
    I have attached a sample sheet of how my excel sheet with production overview looks like. Can someone help me rewrite the code to use dynamic arrays? And please make comments as to what is what and so on, so I can learn. Useful articles and guides to dynamic arrays are also more than welcome to be shared, so can nail this VBA programming eventually.
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Help cleaning code, and dynamic arrays

    Something like below?

    Please Login or Register  to view this content.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    12-10-2015
    Location
    Aarhus, Denmark
    MS-Off Ver
    2016
    Posts
    22

    Re: Help cleaning code, and dynamic arrays

    Just tried it, it does excactly what it want it to do. My god did i use a lot of code to do the same, but I guess it will eventually get better

    Thank you very much, as I expected it could be done much easier and simpler, and I was proven right. And thank you for the comments, it is very easy to understand the process then.

    Quote Originally Posted by CK76 View Post
    Something like below?

    Please Login or Register  to view this content.

+ 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. Help cleaning up code.
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2015, 10:59 AM
  2. Looking for help Cleaning up code
    By SmoothRider in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2014, 02:58 PM
  3. [SOLVED] Need help cleaning up my code...
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2014, 12:30 PM
  4. [SOLVED] Help with cleaning up code ?
    By james 35 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2013, 06:05 AM
  5. Cleaning up this code
    By toaksie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2012, 05:50 PM
  6. Code needs cleaning up
    By hambone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2010, 10:51 AM
  7. Help Cleaning up Code
    By Lost and Looking for Help in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2006, 09:30 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