Dim
lngSp
As
Long
Dim
strAdr
As
String
Dim
lngCnt
As
Long
Dim
strErg
As
String
lngSp = iFillList
strAdr = Sheet3.Cells(10, lngSp).Address
lngCnt = InStr(2, strAdr,
"$"
) - 1
strErg = WorksheetFunction.Substitute(Left(strAdr, Len(strAdr) - (Len(strAdr) - lngCnt)),
"$"
,
""
)
Die ganze Schleife sieht nun so aus :
For
Each
dok
In
Dokumente
If
UserForm1.ComboBox1.value = dok
Then
For
iFillList = 2
To
range(
"Z10"
).
End
(xlToRight).Column
If
Sheet3.Cells(10, iFillList) <>
""
Then
If
UserForm1.ComboBox1.value = Sheet3.Cells(10, iFillList)
Then
lngSp = iFillList
strAdr = Sheet3.Cells(10, lngSp).Address
lngCnt = InStr(2, strAdr,
"$"
) - 1
strErg = WorksheetFunction.Substitute(Left(strAdr, Len(strAdr) - (Len(strAdr) - lngCnt)),
"$"
,
""
)
strSpalte = strErg &
"200"
For
iVar = 11
To
range(strSpalte).
End
(xlDown).Row
If
Sheet3.Cells(iVar, iFillList) <>
""
Then
UserForm1.ListBox1.AddItem Sheet3.Cells(iVar, iFillList)
Else
End
If
Next
iVar
Else
End
If
Else
:
GoTo
Fin
End
If
Next
iFillList
Else
End
If
Fin:
Next