Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sheets("Data List").Select
- With Worksheets("Data List").Range("A1", Sheets("Data List").Range("C1").End(xlDown))
- .AutoFilter field:=1, Criteria1:=UserForm1.ListBox3.List(k) 'filter data based on user listbox selection
- For j = 0 To UserForm1.ListBox1.ListCount - 1 'Find user selection from LB3 in LB1 to match filtered data order
- If UserForm1.ListBox3.List(k) = UserForm1.ListBox1.List(j) Then Exit For
- Next j
- For h = 0 To UBound(dataArr, 2)
- If dataArr(j, h) = 1 Then 'If the user has selected they want this data then add it to the array
- Set myRange = Sheets("Data List").AutoFilter.Range().SpecialCells(xlCellTypeVisible)
- myRange.Select
- arr1(l) = myRange.Cells(h + 2, 2)
- arr2(l) = myRange.Cells(h + 2, 3)
- l = l + 1
- End If
- Next h
- .AutoFilter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement