ich möchte gern eine Nummerierung durchführen.
Es soll in Spalte A losgehen, in der Spalte A bis die letzte belegte Zelle
erreicht ist.
Somit hätte ich dann eine NEUE Durchgängige Nummerierung.
gr Kurt P
Sub Nummerierung()
Dim LetzteBereich As String
Range("A:A").ClearContents
LetzteBereich = "A1:" & Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1).Address
If Cells.SpecialCells(xlCellTypeLastCell).Row > 0 Then
Range("a1") = 1
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 1 Then
Range("a2") = 2
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 2 Then
Range("A1:A2").AutoFill Destination:=Range(LetzteBereich), Type:=xlFillDefault
End If
End Sub
Gruß
Tino
Sub Nummerierung()
Range("A2:A30").ClearContents
Range("A2") = 1
Range("A3") = 2
Range("A2:A3").AutoFill Destination:=Range("A2:A30"), Type:=xlFillDefault
End Sub
Gruß
Tino
Sub Nummerierung()
Dim LetzteBereich As String
LetzteBereich = "A2:" & Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1).Address
Range(LetzteBereich).ClearContents
If Cells.SpecialCells(xlCellTypeLastCell).Row > 1 Then
Range("a2") = 1
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 2 Then
Range("a3") = 2
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 3 Then
Range("A2:A3").AutoFill Destination:=Range(LetzteBereich), Type:=xlFillDefault
End If
End Sub
Gruß
Tino
Sub Nummerierung()
Dim LetzteBereich As String
LetzteBereich = "A2:" & Range("A65500").End(xlUp).Address
Range(LetzteBereich).ClearContents
If Cells.SpecialCells(xlCellTypeLastCell).Row > 1 Then
Range("a2") = 1
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 2 Then
Range("a3") = 2
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 3 Then
Range("A2:A3").AutoFill Destination:=Range(LetzteBereich), Type:=xlFillDefault
End If
End Sub
Gruß
Tino
Sub Nummerierung()
Dim LetzteBereich As String
LetzteBereich = "A2:" & Range("A65500").End(xlUp).Address
Range(LetzteBereich).ClearContents
If Range("A65500").End(xlUp).Row > 1 Then
Range("a2") = 1
End If
If Range("A65500").End(xlUp).Row > 2 Then
Range("a3") = 2
End If
If Cells.SpecialCells(xlCellTypeLastCell).Row > 3 Then
Range("A2:A3").AutoFill Destination:=Range(LetzteBereich), Type:=xlFillDefault
End If
End Sub
Sub test()
Dim i As Long
With ActiveSheet
For i = 2 To .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(i, 1).Value = i - 1
Next
End With
End Sub
Gruß Gerd