Dear All,
I have this code to define an array and populate a listbox>
I'd like to change it to show only visible cell so when I apply a filter to the sheet I can update the listbox on filtered data.
Thank you in advance
miami2k
I have this code to define an array and populate a listbox>
VBA Code:
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("TimeSheet")
Dim arrTwoD()
Dim intRows
Dim intCols
Dim i As Integer
Dim j As Integer
intRows = ws.UsedRange.Rows.Count
intCols = 8
ReDim Preserve arrTwoD(1 To intRows, 1 To intCols)
For i = 1 To UBound(arrTwoD, 1)
For j = 1 To UBound(arrTwoD, 2)
arrTwoD(i, j) = ws.Cells(i, j)
Next
Next
With Scadenziario.ListBox1
.Clear
.ColumnCount = 8
.ColumnWidths = "0;180;120;60;60;60;60;270;"
End With
Scadenziario.ListBox1.List = arrTwoD
Sheets("SCFI").Select
I'd like to change it to show only visible cell so when I apply a filter to the sheet I can update the listbox on filtered data.
Thank you in advance
miami2k