As DM says
Let's say that the value is 1234 or 001234

1.-
Store the value in a string variable, let's say MyStr
Convert to numeric
Dim X As Integer
X = CInt(MyStr)
Then convert to desired output using Format
MyStr = Format(X, "00000")

Or
2.-
Store the value in a string variable, let's say MyStr
Then if length equal to 4 then add one 0
If Len(MyStr) = 4 Then MyStr = "0" & MyStr
If the length is equal to 5 then cut first 0
If Len(MyStr) = 5 Then MyStr = Mid(MyStr,2)