ich brauche mal Profi Unterstützung.......
Ich versuche Daten von einer zur anderen Tabelle zu übertragen mit voriger Prüfung in Zeilen und Spalten.
Set wksQ = ThisWorkbook.Worksheets("Data")
Set wksZ = ThisWorkbook.Worksheets("Zeiten ")
Letzte1 = ThisWorkbook.Worksheets("Data").Cells(Rows.Count, "A").End(xlUp).Row
Letzte2 = ThisWorkbook.Worksheets("Zeiten").Cells(Rows.Count, "A").End(xlUp).Offset(5, 0).Row
For Q_x = 2 To Letzte1
If wksQ.Cells(Q_x, 7) = "x" Then
Artikel = wksQ.Cells(Q_x, 3)
Menge = wksQ.Cells(Q_x, 13)
Woche = wksQ.Cells(Q_x, 11)
For Z_X = 3 To Letzte2
If wksZ.Cells(Z_X, 3) = Artikel Then
MyRow = Z_X
For x = 9 To 248
If wksZ.Cells(6, x) = Woche Then
MyCol = x
wksZ.Cells(MyRow, MyCol) = Menge
End If
Next
End If
Next
End If
Next
Set wksQ = ThisWorkbook.Worksheets("Data")
Set wksZ = ThisWorkbook.Worksheets("Zeiten")
Letzte1 = ThisWorkbook.Worksheets("Data").Cells(Rows.Count, "A").End(xlUp).Row
Letzte2 = ThisWorkbook.Worksheets("Zeiten ").Cells(Rows.Count, "A").End(xlUp).Offset(5, 0).Row
For Q_x = 2 To Letzte1
If wksQ.Cells(Q_x, 7) = "y" Then
Artikel = wksQ.Cells(Q_x, 3)
Menge = wksQ.Cells(Q_x, 9)
Woche = wksQ.Cells(Q_x, 6)
For Z_X = 3 To Letzte2
If wksZ.Cells(Z_X, 3) = Artikel Then
MyRow = Z_X
For x = 9 To 248
If wksZ.Cells(6, x) = Woche Then
MyCol = x
wksZ.Cells(MyRow, MyCol) = Menge
End If
Next
End If
Next
End If
Das ganze funktioniert auch soweit allerdings versuche ich das ganze (x und y) zusammenzufassen.
Desweitern dauert der Code bei der Anzahl von Zeilen und Spalten über 8 Minuten.
Gibt es andere Möglichkeiten sowas umzusetzen bzw das ganze zu beschleunigen ?
Ich bin gerade froh das ich es so zusammengebaut habe das es überhaupt funktioniert.
Alles andere liegt weit über meinen können...
Würde mich wirklich sehr freuen wenn ihr mir helfen könntet.
Viele Grüße
Besten Dank
der Mani