I have an Excel workbook that I Archive data. I take data from my main worksheet and Archive them in different worksheet.
This is the Code that I perform to do that but when I run it, it freezes my Laptop and doesnt perform anything :
Sub trasnfer()
Dim i As Long, j As Long, lastrow1 As Long, lastrow2 As Long
Dim SSL As String
Dim Baureihe As String
Dim Produktionsjahr As String
Dim Garantiejahr As String
Dim RateEA1 As String
Dim RateEa2 As String
Application.screenupdating = false
lastrow1 = Sheets("Transponieren").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow1
SSL = Sheets("Transponieren").Cells(i, "A").Value
Baureihe = Sheets("Transponieren").Cells(i, "B").Value
Produktionsjahr = Sheets("Transponieren").Cells(i, "C").Value
Garantiejahr = Sheets("Transponieren").Cells(i, "D").Value
RateEA1 = Sheets("Transponieren").Cells(i, "E").Value
Sheets("Absatzmenge").Activate
lastrow2 = Sheets("Absatzmenge").Range("A" & Rows.Count).End(xlUp).Row
For j = 2 To lastrow2
If Sheets("Absatzmenge").Cells(j, "A").Value = Baureihe Then
If Sheets("Absatzmenge").Cells(j, "B").Value = Produktionsjahr Then
'If Sheets("Absatzmange").Cells(j, "C").Value = Produktionsjahr Then
'If Sheets("Absatzmenge").Cells(j, "D").Value = Garantiejahr Then
'If Sheets ("Absatzmenge").Cells(j, "E").Value = RateEA1 then
Sheets("Transponieren").Activate
Sheets("Transponieren").Range(Cells(i, "A").Cells(i, "E")).Copy
Sheets("Absatzmenge").Activate
Sheets("Absatzmenge").Range(Cells(j, "E").Cells(j, "H")).Select
ActiveSheet.Paste
End If
End If
Next j
Application.CutCopyMode = False
Next i
Application.screenupdating = True
Sheets("Transponieren").Activate
Sheets("Transponieren").Range("A1").Select
End Sub
I tried in much powerful pc but it does the same. Thank you.