+ Reply to Thread
Results 1 to 3 of 3

Macro to Copy and paste folders and subfolders without files in it

  1. #1
    Registered User
    Join Date
    12-19-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2007
    Posts
    16

    Macro to Copy and paste folders and subfolders without files in it

    Hi Experts,

    Need your help.

    I'm in need of a macro which copies and paste all the folders and sub-folders in another location without copying the contents(files). In other words, when the macro is run, all the folders and sub-folders of the source folder should be copied to target folder but there should not be any files copied to the target folder. Which means, now the target folder should have only the folders, sub-folders and sub-subfolders and so on.. without any files in it.

    Hope my explanation and requirement is clear to understand.

    Immediate help is highly appreciated.

    Thanks in advance.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to Copy and paste folders and subfolders without files in it

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    12-19-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2007
    Posts
    16

    Re: Macro to Copy and paste folders and subfolders without files in it

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    First of all, thank you so much for your time and help.

    Macro is working absolutely fine as i was expecting, however I found that if the length folder path(strNewFolder - in above macro) is morethan 250 characters, a runtime error 76 (Path not found) is popping up. Could you please help me resolve this.

+ 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. VBA macro that copy files from multiple subfolders
    By R12345 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-14-2016, 03:22 AM
  2. Needs macro to copy excel files from folders, subfolders to new folder
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2014, 08:53 AM
  3. [SOLVED] Search for files in folders and subfolders
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2014, 08:43 AM
  4. Macro Code to Encrypt Multiple Excel Files in Folders and Subfolders
    By ali_1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2014, 12:53 PM
  5. How to copy and paste Files and folders into Excel
    By chris8116 in forum Excel General
    Replies: 2
    Last Post: 06-02-2011, 05:55 PM
  6. [SOLVED] Map/List of folders, subfolders & files
    By Bogdan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2006, 01:10 PM
  7. [SOLVED] copy subfolders, replace text in files and save files in copied subfolders
    By pieros in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2005, 09:05 AM

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