Missing Zero

B

Beebolbod

Hi,

Why when doing search and replace against variable xxx with a value such as
06 does xxx always end up as 6? I want to preserve the leading zero.
I've changed the format of the cells to no avail.

Any ideas?

BR

Rob
 
B

Beebolbod

Thanks Rick,

I'm currently doing just that and it seems to be working when the vairable
is isolated in it's own cell.
I am however modifying this variable within a long line of other code which
is mixed with text/characters and numbers. Will this look to format only
numbers within a line of stuff?

BR

Rob
 
R

Rick Rothstein \(MVP - VB\)

It looks like if you use 06 instead of just 6, then replacements inside of
text will preserve that leading zero because the replacement is pure text
for text... the Format is needed only to handle numbers by themselves
because numbers do not naturally support leading zeroes.

Rick
 
B

Beebolbod

Thanks Rick. Seems to work ok!

Rick Rothstein (MVP - VB) said:
It looks like if you use 06 instead of just 6, then replacements inside of
text will preserve that leading zero because the replacement is pure text
for text... the Format is needed only to handle numbers by themselves
because numbers do not naturally support leading zeroes.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top