Sub Nummerierung()
Dim i As Long, n As Long
n = 1
With Sheets("Stroke_2")
For i = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
If .Cells(i, "A") <> "" Then
.Cells(i, "C") = n
n = n + 1
End If
Next
End With
End Sub
Habe es mal wie unten versucht, aber das scheitert natürlich daran, dass ich nur ein bestimmtes Arbeitsblatt anspreche. Ich habe bereits versucht händisch mehr Blätter hinzuzufügen indem ich "With Sheets("Stroke_2", "Stroke_3", "Stroke_4")" eingefügt habe, aber es funktioniert leider nicht.
Sub NummeriereReiheCAllerArbeitsblaetterAusserImErstenSheet()
Dim xSh As Worksheet
Application.ScreenUpdating = False
For Each xSh In Worksheets
xSh.Select
Call Nummerierung
Next
Application.ScreenUpdating = True
End Sub
Sub Nummerierung()
Dim i As Long, n As Long
n = 1
With Sheets("Stroke_2")
For i = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
If .Cells(i, "A") <> "" Then
.Cells(i, "C") = n
n = n + 1
End If
Next
End With
End Sub