+ Reply to Thread
Results 1 to 4 of 4

Change existing code to give option for Move files or Copy Files

  1. #1
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    548

    Change existing code to give option for Move files or Copy Files

    Hello smart people,


    I found some clever code that works reallyl well. The only thing is that this code moves the files. Is there a way to augment this code so that it gives me an option to Move or Copy from one folder to the next. Some times I want to move and sometimes I want to just copy the file contents.

    If anyone has the time to help I would appreciated.
    Enjoy your weekend all!

    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,645

    Re: Change existing code to give option for Move files or Copy Files

    Hi there,

    It's not really possible for me to test this properly without access to your lists of files etc., but see if the following knee-jerk additions to your code get you moving in the right direction:

    Please Login or Register  to view this content.
    You should note that it can be extremely dangerous to insert an "open-ended" On Error Resume Next statement in a routine. As an example of what can go wrong, if under normal circumstances you try to select a worksheet which doesn't exist and then delete all of its contents, an error message will be generated - if you begin the routine with an On Error Resume Next statement, no error message will be generated and the contents of whichever worksheet happens to be active will be deleted instead!

    Whenever you disable Excel's own error handling, you should re-enable it (On Error GoTo 0) as soon as possible afterwards.


    Hope this helps.

    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    11-19-2019
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    548

    Re: Change existing code to give option for Move files or Copy Files

    Greg, thank you. I just tested the code and it does what its supposed to. Thank you so much for taking the time out of your day to help me. Much appreciated!

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

    Re: Change existing code to give option for Move files or Copy Files

    Hi again,

    Many thanks for your 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. Option to copy files
    By pm83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2018, 02:22 PM
  2. VB Code to move the pdf files
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-15-2016, 08:25 PM
  3. [SOLVED] VB Code to Move Files
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-27-2015, 02:16 PM
  4. Replies: 2
    Last Post: 02-10-2014, 11:52 AM
  5. Application.GetOpenFilename, Attach files to Email, Move files, Delete Original.
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2009, 12:11 AM
  6. Limit macro conversion to only .txt files or delete existing .xls files
    By macro_noob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2008, 03:54 PM
  7. updating multiple files, how do I track files that give errors?
    By jojotherider in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2008, 03:45 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