Results 1 to 4 of 4

Create a user form with a multi-column list box

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    04-11-2006
    MS-Off Ver
    2007
    Posts
    438

    Smile Create a user form with a multi-column list box

    Hello all,

    I had a macro previously solved here by protonleah (thanks protonleah)

    Here's the link...

    http://www.excelforum.com/excel-prog...-criteria.html


    Here's the code:

    Option Explicit
    Sub test()
        Application.ScreenUpdating = False
        Dim TestDate    As Date, _
            DateRange   As Range, _
            DateCol     As Long, _
            LastRow     As Long, _
            ctrl        As Long, _
            FirstRow    As Long
    
    'find the column with "date opened"
        For ctrl = 1 To 256
            If Cells(1, ctrl).Value = "date opened" Then
                DateCol = ctrl
                Exit For
            End If
        Next ctrl
        
        FirstRow = 2        '<============== change to suit
        
        LastRow = Cells(Rows.Count, DateCol).End(xlUp).Row
        TestDate = InputBox("enter the earliest date to use: mm/dd/yyyy")
        
        Range(Cells(FirstRow, DateCol), Cells(LastRow, DateCol)).Select
    
        Selection.Sort _
            Key1:=Cells(FirstRow, DateCol), _
            Order1:=xlAscending, _
            Header:=xlGuess, _
            OrderCustom:=1, _
            MatchCase:=False, _
            Orientation:=xlTopToBottom
            
        Cells(FirstRow, DateCol).Select
        
        For ctrl = LastRow To FirstRow Step -1
            If Cells(ctrl, DateCol).Value < TestDate Then
                Cells(ctrl, DateCol).EntireRow.Delete
            End If
        Next ctrl
        
        Application.ScreenUpdating = True
    End Sub
    I however, would like to modify this code to instead, bring up a list of states that can be selected via checkmark inside a checkbox.

    Keep in mind that my data will not actually be states, this is dummy text and data pulled would be from the column named "Date Opened".

    Pressing "Cancel", "OK" or "Select All" would automatically keep all "states"

    I've attached a sample picture of what I am looking for.

    Is this possible?

    thanks much
    Attached Images Attached Images
    Last edited by duugg; 07-23-2009 at 10:39 AM. Reason: searchability

Thread Information

Users Browsing this Thread

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

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