How do I get a number to show up with a leading 0. Fox example I would like 8 to show up as 08 and 11 to continue to show up as 11, not 011.

I tried this but I'm missing something.

Dim monthformat As Double

monthformat = (Monthminusone - 1)

Format(monthformat, "00")

MessageBox.Show(monthformat)

MessageBox.Show(monthformat.ToString("00"))

Alternatively, you can save the formatted month number as a string:

Dim monthformat As Double, strmonth As String

strmonth = monthformat.ToString("00")

MessageBox.Show(strmonth)