View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Preserving leading zero

Hello,

I'm certain that there should be a way to preserve a leading zero when
you don't know the length of the string - but I certainly don't know how.

I have a string like "010-056". If I put the variable in a watch window
- it comes up as a string. The problem is that I need to get rid of the
"-". When I do this, the string becomes a number.

Because the left character is not always a zero and, as I mentioned, the
length of the string varies, I cannot figure out how to keep the leading
zero intact when I replace the "-".

Does anybody have a solution to this?

Any help in this would be most appreciated.

Thanks much in advance.

Anita