View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Philosophaie Philosophaie is offline
external usenet poster
 
Posts: 110
Default "000" reverts back to "0" even with a string

I want to have a 4 digit number in all cases but some have 0 thru 3.

This is how I attempted to solve it:

dim x(3) as string
x(1)=234
x(2)=67
x(3)=5
If Len(x(m)) = 1 Then x(m) = 000 & x(m)
If Len(x(m)) = 1 Then x(m) = 00 & x(m)
If Len(x(m)) = 1 Then x(m) = 0 & x(m)
the problem is when you enter "000" in for the result it automatically
reverts back to "0"