+ Reply to Thread
Results 1 to 2 of 2

vba - loop through

  1. #1
    Registered User
    Join Date
    03-28-2012
    Location
    manchester, england
    MS-Off Ver
    Excel 2010
    Posts
    2

    vba - loop through

    Hi

    I have code that loops through a folder and applys formats to a set of reports located in the defined folder.
    The first part of the code is below which starts the loop.
    Note the fpath commented out is the hardcoded path where as the range.value is a defined range in my spreadsheet to make it more dynamic.

    However i want to do multiple months at once, as these reports always have the same name, is there a way of say applying this loop to two folders at the same time?
    eg fpath = range("reportsaug","reportsjuly")..... for example

    I could add the whole set of code in again for the two folders but it is extremely long and would become messy (especially if i wanted to go through more than two folders)


    Please Login or Register  to view this content.
    Last edited by arlu1201; 08-14-2012 at 07:13 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: vba - loop through

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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