+ Reply to Thread
Results 1 to 6 of 6

Trying to change verbose looping code into more efficient (and shorter) code please

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Question Trying to change verbose looping code into more efficient (and shorter) code please

    Hi All,

    Thank you for your input so far - it is appreciated.

    I am trying to turn a very long winded and verbose section of code (below) into something much more efficient and shorter. I am sure loops are the answer, but can't quite wrap my head around a solution and would appreciate some suggestions please. You will see what I mean when you see the code section (part of - at least enough to make the issue clear I hope):

    Please Login or Register  to view this content.
    I still have Thursday to sunday to go as well and as you might imagine my current approach is ugly and long-winded.

    Thank you for your continued assistance.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Trying to change verbose looping code into more efficient (and shorter) code please

    There's not enough info in your post to test, but maybe something like ...

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Trying to change verbose looping code into more efficient (and shorter) code please

    Thanks - I will give it a try.

    Could I not just create some counters for the values (highlighted) below?

    Please Login or Register  to view this content.
    as these are the only parts that change, as I must admit I'm not entirely sure what your code does and it is important for me to understand the code in order to learn from it.

    Thanks again.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Trying to change verbose looping code into more efficient (and shorter) code please

    It's a single array formula that returns an entire row of the table rather than doing the lookup 45 times in each row.

  5. #5
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Trying to change verbose looping code into more efficient (and shorter) code please

    OK. Thank you - will let you know how I get on!

  6. #6
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Trying to change verbose looping code into more efficient (and shorter) code please

    You are a star! Thank you very much indeed for you efforts!

+ 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