Tak skúste niečo takéto (Stĺpec C má formát Text):
Sub IncreaseNumber()
Dim Hodnota, Riadok As Long
With ThisWorkbook.Worksheets("Hárok1")
Hodnota = .Cells(5, 3)
If Hodnota = "" Or Not IsNumeric(Hodnota) Then
.Cells(5, 3) = "0001"
Else
Riadok = .Cells(Rows.Count, 3).End(xlUp).Row
If Riadok + 1 > 5 Then .Cells(Riadok + 1, 3) = Format(Val(.Cells(Riadok, 3)) + 1, "0000")
End If
End With
End Subcitovat
Sub IncreaseNumber()
Dim Hodnota, Riadok As Long
With ThisWorkbook.Worksheets("Hárok1")
Hodnota = .Cells(5, 3)
If Hodnota = "" Or Not IsNumeric(Hodnota) Then
.Cells(5, 3) = "0001"
Else
Riadok = .Cells(Rows.Count, 3).End(xlUp).Row
If Riadok + 1 > 5 Then .Cells(Riadok + 1, 3) = Format(Val(.Cells(Riadok, 3)) + 1, "0000")
End If
End With
End Subcitovat