+ Reply to Thread
Results 1 to 4 of 4

VBA for Coying Files and folders

  1. #1
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    VBA for Coying Files and folders

    Hello All,

    Could someone help me with attached VBA code.

    I have googled and found this code. I had made few changes in the attached code but i am getting error.

    Kindly look into this.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: VBA for Coying Files and folders

    It is not clear what you are trying to do, but I can drew your attention to a few things.

    1. You have declared fFromPath and tToPath, but in your code you haven't used them. Instead you used FromPath. These variables need to be consistent.

    2. When you assigned a path to a variable, you used f and t instead of B]fFromPath[/B] and tToPath

    3. In the filepaths in cells B1 and B2, you don't have a "\" at the end. You have code looking for that in the IF statements.

    This is what I mean!

    Please Login or Register  to view this content.
    It now exits with a message "C:\20041 doesn't exist" on my PC which was expected.

    See how you go!

    Regards

    David


    When you reply please make it clear WHO you are responding to by mentioning their name.
    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.
    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

  3. #3
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: VBA for Coying Files and folders

    Wow!! Its working.

    Thank You..

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: VBA for Coying Files and folders

    Quote Originally Posted by mvinay View Post
    Wow!! Its working.

    Thank You..
    You're welcome!

    Don't forget to mark your thread as SOLVED and to click the *Add Reputation button at the bottom left.

    DAC

+ 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. How to copy and rename files in vba by searching multiple folders for files
    By razorace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2014, 04:21 AM
  2. Replies: 1
    Last Post: 09-12-2013, 09:23 PM
  3. Recursively Count Files in Folders and Sub-Folders
    By cdeshaz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2013, 01:15 PM
  4. Archiving Files - Creating New Folders and Moving Files
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2011, 06:47 AM
  5. Create folders and move and copy files into that folders
    By vijaybharthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2010, 04:01 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