+ Reply to Thread
Results 1 to 4 of 4

VBA Copy list from filter and pasting into a column

  1. #1
    Registered User
    Join Date
    09-09-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    VBA Copy list from filter and pasting into a column

    I have columns on Sheet 1 with a filters and I want a way to make a list on Sheet 2 of each item (with out repeating) that is in the corresponding column on sheet 1.

    This will be programmed in a userform to create the list when the form is loaded.

    The end result being this:
    CopyFilterList.png

    This is an example and there could be up to 50 or more options.

    Thanks!

  2. #2
    Registered User
    Join Date
    09-09-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA Copy list from filter and pasting into a column

    anyone have any ideas for me??

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,791

    Re: VBA Copy list from filter and pasting into a column

    You could try a macro like this.

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    09-09-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA Copy list from filter and pasting into a column

    Quote Originally Posted by Alf View Post
    You could try a macro like this.

    Please Login or Register  to view this content.
    Alf
    Close... but it will return a single item multiple times and will go into an error if you try to run it twice. I need it to, on some action (like making a sheet active), automatically update the list on sheet two to the most recent list. So for example, if I add "Coffee" to column C of sheet 1, then when i make sheet 2 active, it will add "Coffee" to list 3 in column C.

    Thanks!

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,791

    Re: VBA Copy list from filter and pasting into a column

    but it will return a single item multiple times
    ??????

    No the "AdvancedFilter" "True" will only retun singel uniqe items but if you have "slopy" data with trailing spaces i.e. "Apples" and "Apples " then it will give you both "Apples" and "Apples " as they both are unique.

    To run the macro multiple times you need to clear sheet2 so adding these lines will fix this problem.

    Please Login or Register  to view this content.
    Alf
    Last edited by Alf; 02-24-2014 at 01:59 AM.

+ 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. Replies: 0
    Last Post: 01-16-2014, 10:55 AM
  2. Filter List by Keyword & copy the result in column by keyword as header
    By kitunga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2013, 07:16 AM
  3. Keeping Drop Down List intact while copy-pasting
    By singhabhijitkumar in forum Excel General
    Replies: 5
    Last Post: 02-08-2010, 07:25 AM
  4. Replies: 1
    Last Post: 04-24-2009, 02:09 PM
  5. Replies: 18
    Last Post: 12-31-2005, 06:55 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