Good Morning,
I'm trying to Frankenstein some code together to build a report-like userform.
It works for what I need aside from only listing the information on a single column. Hows it setup is that a User can select a list of buttons , depending on what is selected the buttons are assigned a value that is sent to an assigned cell. Based on the value of that cell, the userform will filter the data. The way it is now, works for what I want so multiple people can pick up reports at the same time.
If anyone knows a way to modify this allow the first column to be to be filtered but show the entire row. I'd truly appreciate it.
The code;
Dim i As Long
Dim arrLists As Variant
With Sheet8
Me.ListBox1.Clear
If.Range("A" & .Rows.Count).End(xlUp).Row > 1 And Trim(Sheet2.Range("AP6").Value) <> vbNullString Then
arrLists = .Range("A1:G25" & .Range("A" & .Rows.Count).End(xlUp).Row).Value
For i = LBound(arrLists) To UBound(arrLists)
If InStr(1, arrLists(i, 1), Trim(Sheet2.Range("AP6").Value), vbTextCompare) Then
Me.ListBox1.AddItem arrLists(i, 3)
End If
Next i
End If
If Me. ListBox1.ListCount = 1 Then Me.ListBox1.Selected(0) = True
End With
End Sub
Please let me know if I can provide any further details. i will not be able to send a copy of the workbook or sheet.
Bookmarks