erledigt
22.05.2025 18:03:04
Christian
Private Sub Workbook_Open()
Dim ws As Worksheet
Dim lastRow As Long
Set ws = Worksheets("alle")
Application.EnableEvents = False
Application.ScreenUpdating = False
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
With ws
.Range("K1").Formula = "=TODAY()+1"
.Range("K2").Formula = "=XLOOKUP(MIN(I2:I" & lastRow & "), I2:I" & lastRow & ", B2:B" & lastRow & ", """", 0, 1)"
.Range("K3").Formula = "=XLOOKUP(K2, B2:B" & lastRow & ", F2:F" & lastRow & ", """", 0, 1)"
.Range("K4").Formula = "=XLOOKUP(K2, B2:B" & lastRow & ", G2:G" & lastRow & ", """", 0, 1)"
.Range("K5").Formula = "=XLOOKUP(K2, B2:B" & lastRow & ", E2:E" & lastRow & ", """", 0, 1)"
.Range("K6").Formula = "=XLOOKUP(K2, B2:B" & lastRow & ", H2:H" & lastRow & ", """", 0, 1)"
End With
Dim cell As Range
For Each cell In ws.Range("K1:K6")
cell.Value = cell.Value
Next cell
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub