Ja, hast recht habe ich beseitigt. Der Fehler bleibt jedoch, leider. Hier mal der ganze Code:
Sub LeseArtiekNummern()
Dim wbAktiv As Workbook 'Variable Ziel Workbook
Dim wbAL010 As Workbook 'Variable Quelle Workbook
Dim wbSA021 As Workbook
Dim wbSLM0003 As Workbook
Dim wbSLM0022 As Workbook
Dim intLastQuelle As Integer
Dim IntLastAktiv As Integer
Set wbAktiv = ActiveWorkbook 'bestimmung Ziel Workbook
Application.EnableEvents = False
Set wbAL010 = Workbooks.Open(Sheets("StartPage").PfadAL010.Value) 'bestimmung/öffnen Quell 1
Application.EnableEvents = True
intLastQuelle = wbAL010.Sheets(2).UsedRange.Rows.Count 'ermittlung Zeilen in Quell Datei
With wbAL010.Sheets(2) 'Einige Spalten aus der ersten Quelle werden entnommen
.Cells(2, 1).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 1).EntireColumn.Insert
.Cells(2, 2).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 2).EntireColumn.Insert
.Cells(2, 3).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 3).EntireColumn.Insert
.Cells(2, 4).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 4).EntireColumn.Insert
.Cells(2, 6).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 5).EntireColumn.Insert
.Cells(2, 20).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 6).EntireColumn.Insert
' 7 Last Week
' 8 This Week
.Cells(2, 11).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 9).EntireColumn.Insert
' SGF 10
.Cells(2, 26).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 11).EntireColumn.Insert
.Cells(2, 25).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 12).EntireColumn.Insert
.Cells(2, 35).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 13).EntireColumn.Insert
.Cells(2, 37).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 14).EntireColumn.Insert
.Cells(2, 38).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 15).EntireColumn.Insert
' 16 RTO
' 17 RTR
.Cells(2, 12).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 18).EntireColumn.Insert
.Cells(2, 18).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 19).EntireColumn.Insert
.Cells(2, 33).EntireColumn.Copy
wbAktiv.Sheets("Data").Cells(2, 20).EntireColumn.Insert
End With
Application.CutCopyMode = False
wbAL010.Close SaveChanges = False
Application.EnableEvents = False
Set wbSA021 = Workbooks.Open(Sheets("StartPage").PfadSA021.Value) 'bestimmung/öffnung Quell 2
Application.EnableEvents = True
intLastQuelle = wbSA021.Sheets(2).UsedRange.Rows.Count
IntLastAktiv = wbAktiv.Sheets("Data").UsedRange.Rows.Count
For x = 2 To IntLastAktiv
Debug.Print wbAktiv.Sheets("Data").Cells(x, 3).Value
' Hier entseht wohl der Fehler
Workbooks("Workliste Einzeiler.xlms").Sheets("data").Cells(x, 7) = Application.WorksheetFunction.VLookup(Workbooks("Workliste Einzeiler.xlms").Sheets("Data").Cells(x, 3).Value, Workbooks("SA021.xlsm").Sheets(2).Range("C:Q"), 15, False)
Next x
wbSA021.Close SaveChanges = False
' Set wbSLM0003 = Workbooks.Open(Sheets("StartPage").PfadSlm0003.Value)
' Set wbSLM0022 = Workbooks.Open(Sheets("StartPage").PfadSlm0022.Value)
End Sub
|