+ Reply to Thread
Results 1 to 5 of 5

Creating loop that stops after certain string

  1. #1
    Registered User
    Join Date
    03-08-2017
    Location
    Somewhere, Somewhere
    MS-Off Ver
    2016
    Posts
    8

    Creating loop that stops after certain string

    I import our entire trial balance into Excel but for the purposes on this particular spreadsheet, I am only interested in the accounts prior to and including the "total income" account. Therefore, I would like to create an array from a loop that stops after reaching "total income". I would then like to make a drop-down of that list (which may vary in length based on the client and their particular trial balance) but not include any extra blanks. Does anyone know how to do this?

    Thank you!!!
    Attached Files Attached Files
    Last edited by letsExcelebrate; 03-13-2017 at 01:47 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,290

    Re: Creating loop that stops after certain string

    Please post a sample workbook with some typical data and expected results.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert 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: Creating loop that stops after certain string

    Hi letsExcelebrate

    Welcome to the Forum!!!

    This Code does not create an array...uses AutoFilter to accomplish what you've requested...CTRL + k will fire the Code.
    Please Login or Register  to view this content.
    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.

  4. #4
    Registered User
    Join Date
    03-08-2017
    Location
    Somewhere, Somewhere
    MS-Off Ver
    2016
    Posts
    8

    Re: Creating loop that stops after certain string

    that is fantastic! Thank you so much!!!

  5. #5
    Forum Expert 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: Creating loop that stops after certain string

    Hi letsExcelebrate

    You're welcome...glad I could help. Thanks for the Rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Creating string with for loop and if function - unexpected results
    By eg0e in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2015, 10:15 AM
  2. Creating loop to fill a String (s) & xlValidatelist
    By peter_pdj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2013, 11:07 AM
  3. [SOLVED] Do While ....Loop Never Stops
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2013, 09:29 AM
  4. VBA - Loop stops too soon
    By DavidBW in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2013, 06:42 AM
  5. loop that stops when certain value is obtained
    By ukhan12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2013, 10:41 PM
  6. [SOLVED] A Loop does not loop throught. It stops after two cells.
    By AB33 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2012, 01:14 PM
  7. Code Stops in a loop?
    By playtowinpb@msn.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2011, 01:57 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