Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t3783
- ---------------------------------
- Sub Increment_Using_Static()
- Static x As Long
- Dim v As Variant
- x = x + 1
- If x = 1 Then
- Range("A1").Value = "asd-001"
- Else
- v = Range("A1").Value
- Range("A1").Value = Split(v, "-")(0) & "-" & Format(Val(Split(v, "-")(1)) + 1, "000")
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement