+ Reply to Thread
Results 1 to 3 of 3

How to copy and rename files in vba by searching multiple folders for files

  1. #1
    Registered User
    Join Date
    01-04-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to copy and rename files in vba by searching multiple folders for files

    I am new to VBA and I would like to know how I can loop through folders to select files starting with a certain word and copy all of them to a different folder and rename them. The folder structure is given below

    Company 1(parent folder)

    North South East(sub folder) West(sub folder)
    Jan Feb Mar.... Dec Jan Feb Mar.... Dec Jan Feb Mar.... Dec Jan Feb Mar.... Dec

    In the above structure, the files are present inside each folders Jan, feb...Dec under the regions North, South East n west. Please note that I have to select files starting with "Sales" and copy them into a new folder(say results) and rename copied files as Sales1.xls, Sales2.xls etc Any help would be highly appreciated. (Files are not present in the folder company1, north, south, east and east.)

    Please note: I have posted the question here also.

    http://www.mrexcel.com/forum/excel-q...ml#post3676482
    Last edited by razorace; 01-04-2014 at 04:20 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to copy and rename files in vba by searching multiple folders for files

    Hi, razorace,

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...ers-files.html

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    01-04-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to copy and rename files in vba by searching multiple folders for files

    Thank you for pointing my mistake. I respect your point and complied

+ 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. Searching folders for list of files
    By joltremari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2014, 02:09 PM
  2. Replies: 1
    Last Post: 09-12-2013, 09:23 PM
  3. [SOLVED] Copy range from multiple files in multiple folders to single sheet in master WB
    By Royzer in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-18-2012, 03:40 PM
  4. Search Folders and Return Copy files matching multiple criteria
    By akq125 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2012, 11:56 PM
  5. Copy multiple files from folders
    By jeff p in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-30-2009, 02:27 AM

Tags for this Thread

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