+ Reply to Thread
Results 1 to 7 of 7

Macro to find and copy/paste invalid data

  1. #1
    Registered User
    Join Date
    10-14-2014
    Location
    Oxford, England
    MS-Off Ver
    365
    Posts
    66

    Macro to find and copy/paste invalid data

    Hi,

    I am looking for a macro that can scan columns B, C, D and E for any data that is circled as invalid, and then paste the corresponding values from column A into a new range.

    For example (invalid data is bold and red. In reality these cells are circled):

    A B C D
    2 a b d
    6 a b d
    4 a b d
    3 a b d
    5 a b d
    7 a b d


    New range:
    6
    3
    7

    I hope this makes sense!

    Thanks,
    Jamie

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

    Re: Macro to find and copy/paste invalid data

    What does "circled" to you mean? It might not mean the same thing to me. Be more specific on what distinguishes the cells (If "circled" means bold and red only, is it done by conditional formatting?).

    into a new range
    Any more information on what this new range is? Is it for example column J? How about Sheet4 column C?

  3. #3
    Registered User
    Join Date
    10-14-2014
    Location
    Oxford, England
    MS-Off Ver
    365
    Posts
    66

    Re: Macro to find and copy/paste invalid data

    Apologies for not making clear. By 'circled', I'm referring to cells that have been circled by the 'Circle Invalid Data' function in Data Validation.

    The new range can be anywhere. In the example above, maybe starting in F1.

    Hope this has cleared things up

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

    Re: Macro to find and copy/paste invalid data

    I had to look this one up. Learned something new today. Credit of this goes to cytop on ozgrid, I just modified his code to match your needs. It worked when tested on a test workbook:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-14-2014
    Location
    Oxford, England
    MS-Off Ver
    365
    Posts
    66

    Re: Macro to find and copy/paste invalid data

    Hi stnkynts, thanks for your help! This works great for listing the invalid data, but doesn't seem to list the corresponding value in column A (unless I'm doing something wrong?)

    Thanks,
    Jamie

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

    Re: Macro to find and copy/paste invalid data

    Woops that is my fault. Try this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-14-2014
    Location
    Oxford, England
    MS-Off Ver
    365
    Posts
    66

    Re: Macro to find and copy/paste invalid data

    Amazing! Thanks

+ 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. [SOLVED] Macro to find data in source workbook and copy paste to target workbook
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-23-2014, 06:21 AM
  2. Find specific Data copy and paste into Cell Macro VBA
    By kunmateo93 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2014, 10:17 AM
  3. [SOLVED] Macro to Find, copy, paste, find, copy, paste, find, copy, paste, u get the picture....
    By westsoldman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-12-2012, 01:12 AM
  4. [SOLVED] Macro to find SKU in column; then copy data in row and paste special (values)
    By Starkey in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-13-2012, 06:05 AM
  5. macro to find copy and paste
    By lukn4it in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2007, 11:37 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