you are confused by the function of the number format in this line.
if should be
The zeros in quotes tell the Format function how to represent the value of intLastNum + 1. The zeros are digit holders. The Format help says
Digit placeholder. Display a digit or a zero. If the expression has a digit in the position where the 0 appears in the format string, display it; otherwise, display a zero in that position.
If the number has fewer digits than there are zeros (on either side of the decimal) in the format expression, display leading or trailing zeros. If the number has more digits to the right of the decimal separator than there are zeros to the right of the decimal separator in the format expression, round the number to as many decimal places as there are zeros. If the number has more digits to the left of the decimal separator than there are zeros to the left of the decimal separator in the format expression, display the extra digits without modification.
You may have to revise the code you have for getting the most recent value as that only checks last 3 digits.
Bookmarks