Padding with 0's

I have a string of a maximum of 4 integers.  If there is one integer (ie. 1), it must show 0001, if it's 10, then it must be 0010, and if it's 9999 then it must be 9999.  Therefore, how do I "pad" with 0's at the beginning of the string?
mikemonnexAsked:
Who is Participating?
 
DalinConnect With a Mentor Commented:


YourString = CStr(YourInteger)

FinalString = Right ("0000" & yourString, 4)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.