+ Reply to Thread
Results 1 to 4 of 4

VBA Copy data based on set criteria into new sheet

  1. #1
    Registered User
    Join Date
    05-24-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    35

    Post VBA Copy data based on set criteria into new sheet

    Hi all

    I was hoping someone could give me some advice.

    I have the following code that copies certain columns from one worksheet to another. However does anyone know how I can tweak this slightly so I only copy data based on a certain criteria?

    In column R or erow 18 as in the case of the formula below I want to copy only those entries that have the word "Active" entered into the column.

    How could I do this?


    Please Login or Register  to view this content.
    Last edited by indik; 06-01-2015 at 10:25 AM.

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

    Re: VBA Copy data based on set criteria into new sheet

    It is not clear to me what you are wanting to do. Do you mean this?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-24-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    35

    Re: VBA Copy data based on set criteria into new sheet

    Hi Stnkynts

    Thanks for your response. I am trying to copy across certain columns (which I have achieved with the above code) but then I want only the data that = "Active" in column R.

    The code you gave looks exactly like what I want but unfortunately it doesn't work. I have attached a excel sheet with some data to provide an example.

    Is there something that needs to be changed?
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-24-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    35

    Re: VBA Copy data based on set criteria into new sheet

    Hi

    Ok I changed the code you sent (I was being stupid) and got only the values that are Active to be copied over.

    However rather than just returning a filtered list it also returns blank values (where the none active data would have been).


    How do I copy just a filtered list of data based on a the set criteria to another worksheet? (The headings may change so dont think I can do a autofilter. It needs to be based on the column it is in.

    I have attached an updated set of data.
    Attached Files Attached Files

+ 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] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  2. Copy data from one sheet into another based on some criteria without using VB
    By fouzia in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-29-2012, 10:20 AM
  3. Replies: 4
    Last Post: 07-24-2012, 07:09 AM
  4. Copy data from a sheet to other based on a criteria
    By arun88aries in forum Excel General
    Replies: 5
    Last Post: 02-22-2011, 06:13 AM
  5. Copy data to a sheet based on criteria in a range
    By cschaaf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2009, 11:36 PM

Tags for this Thread

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