Sub
suchen()
Dim
rngDatenexportNr
As
Excel.Range
Dim
rngDokumentationNr
As
Excel.Range
Dim
Suchwert
As
Range
Dim
Gefunden
As
Variant
Dim
ZZeile
As
Long
Dim
QZeile
As
Long
Dim
QletzteZeile
As
Long
Dim
SuchZeile
As
Long
Dim
ZName
As
String
With
Worksheets(
"QNamesim"
)
i = .Cells(.Rows.Count,
"A"
).
End
(xlUp).Row
Set
rngDatenexport = .Range(
"A2:A"
& .Cells(.Rows.Count,
"A"
).
End
(xlUp).Row)
End
With
For
Each
Suchwert
In
rngDatenexport.Cells
QRB = 1
Debug.Print QRB
Nochmal:
SuchZeile = Suchwert.Row
DoEvents
Debug.Print Cells(SuchZeile, QRB).Value
Teilname = Cells(SuchZeile, QRB).Value
ZName = Teilname &
".xlsm"
DoEvents
If
ZName =
".xlsm"
Then
GoTo
Nochmal
End
If
Next
With
Workbooks(ZName).Worksheets(ZSheet)
Set
rngDokumentation = .Range(
"C3"
, .Cells(.Rows.Count,
"C"
).
End
(xlUp))
End
With
Gefunden = Application.Match(Suchwert, rngDokumentation, 0)