• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Multi Criteria Filtering Listbox to figure out Long text field

Afarag

Member
Dears,

please i need help in solving this issue, as i have a code that let me filter multiple field to filter a data to userform listbox.
but the data that i need to get considered as a long paragraph "text", i want to preview in multiple lines but not one line also need to copy to clipboard this filtered output

Code:
Private Sub English_Click()
Dim Source As Range, c As Range, i%, Aux As Worksheet
Dim fa As Range, nc%, ca, v As Range, A As Worksheet, s$
MthlyDailyIdentifier = "English"
Me.ListBox1.ColumnCount = 1
ListBox1.Clear
Application.ScreenUpdating = True
Set A = ThisWorkbook.Sheets("English")
Set Aux = ThisWorkbook.Sheets("popup")    ' auxiliary sheet
Set Source = A.Range("A1:C1")
Set c = A.Range("a1").CurrentRegion
Source.AutoFilter Field:=1, Criteria1:=Case_list.Value
Source.AutoFilter Field:=2, Criteria1:=Solution_list.Value
Set v = c.SpecialCells(xlCellTypeVisible)  ' filtered range
Aux.Cells.ClearContents
v.Copy Aux.Range("a1")

Set fa = Aux.Range("a1").CurrentRegion
    nc = fa.Columns.Count
    ca = Array(3)  ' columns you want
      Dim lastRow As Long, j As Long ' put these up top
    ' after copying to Aux, but no need to
    lastRow = Aux.Range("a100000").End(xlUp).Row
    ReDim arr(1 To lastRow, LBound(ca) To UBound(ca))
    For i = LBound(ca) To UBound(ca)
        For j = 1 To lastRow
            arr(j, i) = Aux.Cells(j, ca(i)).Text
        Next
    Next
    Me.ListBox1.List = arr
With Me.ListBox1
Me.ListBox1.BoundColumn = 1
Me.ListBox1.BorderStyle = fmBorderStyleSingle
Me.ListBox1.ColumnHeads = True
Me.ListBox1.BackColor = RGB(255, 255, 255)
Me.ListBox1.ColumnWidths = "200"
Me.ListBox1.BorderStyle = 1
Me.ListBox1.MultiSelect = fmMultiSelectExtended
End With
End Sub

0

the file has a small amount of data but i sized highly 6M :rolleyes:
https://drive.google.com/file/d/0BwxxQXMJl4FLVHhfYXlFRVlsM28/view?usp=sharing

thanks a lot,
 
Hello there.
Can i use a text box or lable instead of using the list box to solve this issue. Is that will be available?
 
Back
Top