How do I keep leading zeros in this code? I am incrementing a value with in a string.
TextBox1.value = "PRO 001"
The output is "PRO 2" I need the leading zeros so the output is "PRO 002".![]()
If CheckBox1.Value = True Then TextBox2.Value = Left(TextBox1.Value, 4) & Replace(TextBox1.Value, "PRO ", "") + 1 Else TextBox2.Value = "" End If
IE:
"PRO 098" would be "PRO 099"
"PRO 099" would be "PRO 100" (No longer need leading zero)
Bookmarks