Public Function NuNext(NuPriv) As String
Dim Nuno%, NN%, Nutex1 As String
Nuno% = Len(NuPriv)
For NN% = Nuno% To 1 Step -1
Nutex1 = Mid(NuPriv, NN%, 1)
If Not (Asc(Nutex1) <= 57 And Asc(Nutex1) >= 48) Then Exit For
Next NN%
Nutex1 = ""
MyNumber = Val(Mid(NuPriv, NN% + 1))
If Len(Format(MyNumber + 1)) < Len(Mid(NuPriv, NN% + 1)) Then
For Nuno% = 1 To Len(Mid(NuPriv, NN% + 1)) - Len(Format(MyNumber + 1))
Nutex1 = Nutex1 & "0"
Next Nuno%
End If
NuPriv = Mid(NuPriv, 1, NN%) & Nutex1 & Format(MyNumber + 1)
NuNext = NuPriv
End Function