F
Francis Hookham
Earlier postings have shown me how to increment a string where the last
characters are numerals so
D01-004
can be incremented to
D01-005
(see code below)
I also need to be able to increment the last character when it is a letter
rather than a number, for instance,
D01-006c
incremented to
D01-006d
Any suggestions?
Francis Hookham
Code used to increment D01-004 to D01-005 is
sZeroes = "0000000000"
sSuffix = Right(sDNum, Len(sDNum) - InStr(sDNum, "-"))
sDNum = Left(sDNum, InStr(sDNum, "-")) & _
Format(sSuffix + 1, Left(sZeroes, Len(sSuffix)))
characters are numerals so
D01-004
can be incremented to
D01-005
(see code below)
I also need to be able to increment the last character when it is a letter
rather than a number, for instance,
D01-006c
incremented to
D01-006d
Any suggestions?
Francis Hookham
Code used to increment D01-004 to D01-005 is
sZeroes = "0000000000"
sSuffix = Right(sDNum, Len(sDNum) - InStr(sDNum, "-"))
sDNum = Left(sDNum, InStr(sDNum, "-")) & _
Format(sSuffix + 1, Left(sZeroes, Len(sSuffix)))