+ Reply to Thread
Results 1 to 8 of 8

Need VBA help to filter and copy data based on specific criteria

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    warsaw
    MS-Off Ver
    Excel 2010
    Posts
    10

    Need VBA help to filter and copy data based on specific criteria

    So I have seen many threads with this but I'm not sure it is quite the same. I am trying to create a macro to copy a huge amount of data but the data that will be copied is dependent on one criteria, I have copied a example table below:

    Code Person role
    dxd bob cleaner
    dave cleaner
    dwe joe admin


    I would like the macro to copy data depending on the role for example it will only copy data from code, person and role if the person's role is admin.

    I have a macro so far which just purely copies all the data....

    Thanks in advance for the help

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need VBA help to filter and copy data based on specific criteria

    Please post your code with the sample attached.

  3. #3
    Registered User
    Join Date
    06-12-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Need VBA help to filter and copy data based on specific criteria

    simply apply advance filter copy tn another location.

  4. #4
    Registered User
    Join Date
    05-22-2013
    Location
    warsaw
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need VBA help to filter and copy data based on specific criteria

    Please Login or Register  to view this content.
    So far I tried to apply advanced filtering and it doesn't work as 'Table1' is specific columns within a larger table

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need VBA help to filter and copy data based on specific criteria

    If you are working on list objects(such as table and pivot table) as opposed to range, the syntax which you are using for worksheet function may not work. One simple solution would be to convert the table in to range first and try the filter.

  6. #6
    Registered User
    Join Date
    05-22-2013
    Location
    warsaw
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need VBA help to filter and copy data based on specific criteria

    Quote Originally Posted by AB33 View Post
    If you are working on list objects(such as table and pivot table) as opposed to range, the syntax which you are using for worksheet function may not work. One simple solution would be to convert the table in to range first and try the filter.
    How would I convert to range? would giving the specific columns a name not help?

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need VBA help to filter and copy data based on specific criteria

    Astrial,
    Please do not reply with quote, just reply will do.
    I saw a table on your sheet name and had assumed you have a table. Do you have a table, or are you using a named range for filtering? If you have a table, go to table itself and convert in to range in(Excel).

  8. #8
    Registered User
    Join Date
    05-22-2013
    Location
    warsaw
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need VBA help to filter and copy data based on specific criteria

    I'm using a named range

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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