+ Reply to Thread
Results 1 to 4 of 4

loop through a list of region names

  1. #1
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    loop through a list of region names

    hi, i have a list of 4 files in cells a1:a4 with the names ce, ne, se, and we. if the file exists in the sub-directory i want to do something with it otherwise nothing and check if the next one exists. right now i am checking to see if each file exists with the code below, but i am doing it 4 times to see if each file exists and then doing some operation. how can i do it in a loop type method so i don't have to duplicate the tasks 4 times? thx.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: loop through a list of region names

    Hi there,

    See if the following routines get you moving in the right direction:

    Please Login or Register  to view this content.
    The highlighted values may be changed to suit your requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: loop through a list of region names

    thx greg. version 2 seems to work nicely.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: loop through a list of region names

    Hi again,

    Many thanks for your very prompt feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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. [SOLVED] Dynamic top 10 list based on region
    By rsamples23 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 02-22-2017, 04:35 PM
  2. Replies: 2
    Last Post: 06-01-2015, 06:23 PM
  3. [SOLVED] need a macro to loop thru names in a drop down list for a timesheet
    By radarzdc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2012, 02:47 AM
  4. Replies: 2
    Last Post: 07-25-2012, 04:15 PM
  5. Replies: 4
    Last Post: 05-17-2012, 06:30 PM
  6. List of States..I want to sort and graph by region
    By amsgwp in forum Excel General
    Replies: 3
    Last Post: 04-21-2009, 02:38 PM
  7. Replies: 1
    Last Post: 10-04-2007, 12:04 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