vba- Tabellenbezug
15.11.2016 20:15:09
Fred
ich lade gefilterte Daten in UF / Listbox1
alles prima, allerdings ist der Bezug zu den Daten immer "nur" auf die aktuelle Tabelle gerichtet (in der man sich gerade befindet).
Meine Frage;
Kann mir jemand den Syntax ändern, so das z.B. die gefilterten Daten aus Tabelle "Lager2" angezeigt werden?
Hier ist der momentane Code:
Private Sub UserForm_Initialize()
Dim arr() As Variant
Dim iRow As Long, iRowU As Long, BLetzte As Long
ListBox1.Clear
BLetzte = IIf(IsEmpty(Range("B65536")), Range("B65536").End(xlUp).Row, 65536)
For iRow = 2 To BLetzte
If Not Rows(iRow).Hidden Then
If Cells(iRow, 2) "" Then
ReDim Preserve arr(0 To 6, 0 To iRowU)
arr(0, iRowU) = Cells(iRow, 1)
arr(1, iRowU) = Cells(iRow, 2)
arr(2, iRowU) = Cells(iRow, 3)
arr(3, iRowU) = Cells(iRow, 4)
arr(4, iRowU) = Cells(iRow, 5)
arr(5, iRowU) = Cells(iRow, 6)
arr(6, iRowU) = Cells(iRow, 7)
iRowU = iRowU + 1
End If
End If
Next iRow
ListBox1.Column = arr
End Sub
mfGFred