Results 1 to 2 of 2

Populate List Box based on Unique values from a column then use as a Criteria

Threaded View

acerlaptop Populate List Box based on... 06-27-2022, 11:53 PM
acerlaptop Re: Populate List Box based... 06-27-2022, 11:59 PM
  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Populate List Box based on Unique values from a column then use as a Criteria

    Good Day!

    I have a template with 2 different macros which gets it's data from another input file.

    1st Macro:
    I need to first populate a list box based on the unique value of a certain column (AZ) of the input file. Once it's populated, the user then selects which among the list he/she wants (one or more values can be selected at once - minimum 1 value).
    NOTE: either List Box (Form Control) or List Box (ActiveX Control) depending on what is applicable - no idea at all

    2nd Macro:
    Use the selected items to copy the rows from the input file then copy to the new file under a certain worksheet name.
    -below is the code used to copy data, but needs editing to copy only those that are under the selected criteria from macro 1.

    'Copy DBI Balances from DBI Input (based on List - Column AZ of DBI Input file)
    Set I_wb_DBI = Application.Workbooks.Open(I_Loc & "\" & "*DBI*.xlsx")
    With I_wb_DBI.ActiveSheet
        I_DBI_lr = .Cells(.Rows.Count, "B").End(xlUp).Row
        I_DBI_lc = .Cells(1, .Columns.Count).End(xlToLeft).Column
        'Revise to copy only rows that the value in column AV si selected in the list
        .Range(.Cells(1, 1), .Cells(I_DBI_lr, I_DBI_lc)).Copy Destination:=O_ws_DBI.Range("A1")
    End With
    With O_ws_DBI
        .Activate
        .Range("A:D").EntireColumn.Delete
        .Pictures.Delete
        With .Range(.Cells(1, 1), .Cells(1, I_DBI_lc - 4))
            .AutoFilter
        End With
        .UsedRange.Copy
        .Cells(1, 1).PasteSpecial Paste:=xlPasteValues
        .Range("C2").Select
        ActiveWindow.FreezePanes = True
    End With
    Attached files.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by acerlaptop; 06-28-2022 at 10:25 PM. Reason: Attachment macro

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] List unique values in a cell based on criteria
    By sriley5 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2021, 04:01 PM
  2. Unique drop down list of values based on criteria in other column(s)
    By SMP77 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-25-2019, 10:44 PM
  3. [SOLVED] Creating a list of unique values based off criteria
    By kristentringali in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-23-2018, 12:54 PM
  4. [SOLVED] populate listbox with unique items based on criteria in column C
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2017, 06:55 PM
  5. [SOLVED] VBA Creating a list of unique values from one column based on criteria from another column
    By bilbo85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2016, 02:38 PM
  6. [SOLVED] List unique values based on multiple criteria
    By tangmere.milli in forum Excel General
    Replies: 6
    Last Post: 01-22-2016, 07:56 AM
  7. List Unique Values Based On Criteria
    By tangmere.milli in forum Excel General
    Replies: 5
    Last Post: 03-16-2015, 09:49 AM

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