+ Reply to Thread
Results 1 to 2 of 2

Autofilter with criteria being the contents of a listbox on a userform

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Autofilter with criteria being the contents of a listbox on a userform

    Hi,

    In my example, there is a userform on which I have populated a listbox with unique values from column A of the source data worksheet. The user is able to copy the items they want to the other listbox by selecting them and using the add item button.

    I then have a macro in module 2 which is called by the OK button on the userform. This macro extracts certain parts of data from the source workbook (SOURCEDATAEXAMPLE.xls) using autofilter and copies to the template worksheets in the target workbook (Sales Analysis Template1(WorkingVersion).xlsm) in which the userform exists.

    This is an example section of the code...... (From Sub Update_Figures in Module 2 of Sales Analysis Template1(WorkingVersion).xlsm)

    (sWs=Source Worksheet, tWs=Target Worksheet)
    Please Login or Register  to view this content.
    In the line I have highlighted in red, I want to autofilter this column based on the items that exist in listbox2 on the userform, rather than defining them spacifically in the code like is done here.

    I would be grateful if someone can show me how to add to/modify my coding to achieve this.

    Please see the attached examples.

    Many thanks,
    Attached Files Attached Files
    Last edited by D.Lovell; 06-05-2014 at 06:48 PM. Reason: Spelling mistake in title

  2. #2
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Autofilter with criteria being the contents of a listbox on a userform

    Actually cancel this request, I seem to have figured it out, did it like this......

    Please Login or Register  to view this content.
    And then...

    Please Login or Register  to view this content.

+ 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. Transfer Data From One Userform Listbox to Another Userform Listbox with 11 columns
    By sparkoft in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2013, 10:54 AM
  2. [SOLVED] userform Multi select listbox - add contents to list
    By tbar05 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-25-2013, 10:25 PM
  3. userform listbox
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-14-2013, 11:09 PM
  4. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  5. Replies: 1
    Last Post: 05-17-2006, 04:50 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