Skip to content

Pad single-digit numbers with a zero

VBA has a Format() function that you can use to pad numbers.

animal = “sinani-” & Format$(i, “00”)
This will pad single-digit numbers with a 0. Your two- and three-digit numbers will continue to work as expected.

From:https://stackoverflow.com/questions/31628535/pad-single-digit-numbers-with-a-zero