+ Reply to Thread
Results 1 to 5 of 5

Getting Copy Error with For If Function

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Getting Copy Error with For If Function

    Hi,
    There are 200 data tables and l can copy any table to other table with macro. l added a sample file.
    Please Login or Register  to view this content.
    Example: When l select Copy No "Z01" (in E31 cell), Macro is copying Z01's data to this table. But When l delete copy No in E31 cell, macro code is starting to find empty no and code is copying any cells for there are a lot of not entered data tables.
    When l delete copy No, macro will not copy anything. How can l solve this situation? Another issue, excel is working slowly for macro code.

    Regards.
    Thanks for your helping.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Getting Copy Error with For If Function

    Deleting an entire row or a single cell will trigger a worksheet change event, in a bad way usually. You can correct for this by adding the two lines of code first:

    Please Login or Register  to view this content.
    also, correct this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Getting Copy Error with For If Function

    l added first code and it worked. But sorry, how can l correct offset code?
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Getting Copy Error with For If Function

    Alan.Offset(17,5)

    Note: It would also be a good idea to have an if statement to capture an occurance where Range("E" & Target.Row) is not found.

  5. #5
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Getting Copy Error with For If Function

    That has worked a treat.
    Thanks for your help. Regards.

+ 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. Copy two array: Function RtlMoveMemory() in Excel 64-bit is error?
    By tuanktcdcn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2013, 02:44 PM
  2. [SOLVED] My copy function won't work - I get error "cannot empty clipboard
    By DenaC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  3. My copy function won't work - I get error "cannot empty clipboard
    By DenaC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. [SOLVED] My copy function won't work - I get error "cannot empty clipboard
    By DenaC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] My copy function won't work - I get error "cannot empty clipboard
    By DenaC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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