Hallo,
so ist es etwas einfacher:
Die Aussage über die Begrenzheit von Forenhilfe bleibt.
mfg
so ist es etwas einfacher:
Code:
Const Pfad As String = "c:\users\xxxxxxxx\desktop\" '<<< anpassen
Sub F_en_V2()
Dim WBQ As Workbook
Dim WQ As Worksheet
Dim WZ As Worksheet
Dim RNG As Range, SP1 As Range, SP2 As Range
Set WZ = Sheets(2) '<<<< prüfen (Sheet2 der Beispieldatei)
lr = WZ.Cells(Rows.Count, 1).End(xlUp).Row
f = Dir(Pfad & "*.xlsx") ' "Papiertige*.xlsx")
Do While Len(f)
Set WBQ = Workbooks.Open(Pfad & f)
Set WQ = WBQ.Sheets(1)
With WQ.Columns(1)
.UnMerge
Set RNG = .Find("Teile-Nr:", , xlValues, xlWhole)
If Not RNG Is Nothing Then
Adr = RNG.Address
Do
lr = lr + 1
WZ.Cells(lr, 1) = .Cells(19, 1)
Set SP1 = RNG.End(xlToRight)
SP1.Resize(8).Copy
WZ.Cells(lr, 2).PasteSpecial Transpose:=True
Set SP2 = SP1.End(xlToRight).End(xlToRight)
SP2.Resize(5).Copy
WZ.Cells(lr, "j").PasteSpecial Transpose:=True
Set RNG = .FindNext(RNG)
Loop Until RNG.Address = Adr
End If
End With
WBQ.Close 0
f = Dir
Loop
End Sub
Die Aussage über die Begrenzheit von Forenhilfe bleibt.
mfg