Thema Datum  Von Nutzer Rating
Antwort
30.03.2021 08:42:20 N30Lexx
Solved
30.03.2021 09:16:19 Mase
NotSolved
30.03.2021 18:33:06 N30Lexx
NotSolved
30.03.2021 19:28:33 xlKing
NotSolved
Rot Laufzeitfehler 9 Index außerhalb des gültigen Bereichs
30.03.2021 19:49:53 N30Lexx
NotSolved
30.03.2021 20:00:46 ralf_b
NotSolved
30.03.2021 20:18:11 N30Lexx
NotSolved
30.03.2021 20:27:33 N30Lexx
NotSolved
30.03.2021 21:29:09 N30Lexx
Solved
31.03.2021 08:15:15 Mase
NotSolved
31.03.2021 17:35:42 N30Lexx
NotSolved

Ansicht des Beitrags:
Von:
N30Lexx
Datum:
30.03.2021 19:49:53
Views:
297
Rating: Antwort:
  Ja
Thema:
Laufzeitfehler 9 Index außerhalb des gültigen Bereichs

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

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
30.03.2021 08:42:20 N30Lexx
Solved
30.03.2021 09:16:19 Mase
NotSolved
30.03.2021 18:33:06 N30Lexx
NotSolved
30.03.2021 19:28:33 xlKing
NotSolved
Rot Laufzeitfehler 9 Index außerhalb des gültigen Bereichs
30.03.2021 19:49:53 N30Lexx
NotSolved
30.03.2021 20:00:46 ralf_b
NotSolved
30.03.2021 20:18:11 N30Lexx
NotSolved
30.03.2021 20:27:33 N30Lexx
NotSolved
30.03.2021 21:29:09 N30Lexx
Solved
31.03.2021 08:15:15 Mase
NotSolved
31.03.2021 17:35:42 N30Lexx
NotSolved