+ Reply to Thread
Results 1 to 4 of 4

Document copy and paste macro errors

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Document copy and paste macro errors

    This macro works as loop which is designed to copy a list of documents and paste them to designated file locations.
    The macro works fine except often times when I am copying and pasting a long list of file addresses there may be an incorrect file address or document name mixed into the list.
    If this is the case the macro gets an error until I am able to identify which address is incorrect and fix it.

    The details are:
    The file addresses where the document to be copied is currently located is in Column F and
    The file addresses where the document is going to be pasted is located in Column G.
    Column D contains the document name.
    The macro will copy and paste the documents located in Columns F and G for every row in Column D which contains data.
    The starting row is Row 3.

    What I need help with is creating a line a code which will identify which lines contains an error so I can quickly identify which address needs to be fixed.
    Or in other words I would like the macro to identify which row in the spreadsheet is stopping the program from completing.

    The solution that I believe will work best for me is if this code could scan through identify any errors first and if there are any errors then the code will
    highlight them on the spreadsheet and stop the macro with a message box. However, if anyone else has a better idea I am open to suggestions.

    If no errors are found then it just runs the code like normal.

    Can anyone help with that?

    Please Login or Register  to view this content.

    Document Moving Macro.xlsm
    Last edited by glide2131; 06-25-2015 at 02:40 PM.

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

    Re: Document copy and paste macro errors

    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
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Document copy and paste macro errors

    That is fantastic! Thank you so much.

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

    Re: Document copy and paste macro errors

    You're welcome. Thanks for the feedback.

+ 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 Copy & Paste errors
    By xlquestions in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2015, 03:00 PM
  2. Macro to copy and paste from another Word 2007 document.
    By Excelnoub in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2014, 09:06 PM
  3. Macro that copy all data inside a workbook and paste in value in another document
    By elpoil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 10:07 AM
  4. Macro errors before save of mail merge document
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2011, 02:35 PM
  5. Replies: 1
    Last Post: 10-17-2005, 04: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