Private Sub CommandButton1_Click()
Dim Loletzte As Long
Dim actws As Integer
Dim maxws As Integer
Dim WkzNr As Integer
Dim WkzNrChk As Integer
actws = 2
maxws = ThisWorkbook.Sheets.Count
For x = 1 To (maxws - 1)
ThisWorkbook.Worksheets(actws).Activate
Loletzte = Cells(Rows.Count, 1).End(xlUp).Row + 1
WkzNrChk = Application.WorksheetFunction.Max(ThisWorkbook.Worksheets(actws).Range("A1:A999"))
If WkzNrChk > WkzNr Then
WkzNr = WkzNrChk
End If
actws = actws + 1
Next
MsgBox ("Höchste Werkzeugnummer ist " & WkzNr)
End Sub