Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing Zero
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing Zero
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 "Rick Rothstein (MVP - VB)" wrote: Try clicking the Format button next to the "Replace with" field and set a Custom Format of 00 there. After doing that, you can just specify 6 as the "Replace with" entry as the Custom Format will handle adding the leading zero for you. Rick "Beebolbod" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing Zero
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 "Beebolbod" wrote in message ... 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 "Rick Rothstein (MVP - VB)" wrote: Try clicking the Format button next to the "Replace with" field and set a Custom Format of 00 there. After doing that, you can just specify 6 as the "Replace with" entry as the Custom Format will handle adding the leading zero for you. Rick "Beebolbod" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing Zero
Thanks Rick. Seems to work ok!
"Rick Rothstein (MVP - VB)" wrote: 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 "Beebolbod" wrote in message ... 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 "Rick Rothstein (MVP - VB)" wrote: Try clicking the Format button next to the "Replace with" field and set a Custom Format of 00 there. After doing that, you can just specify 6 as the "Replace with" entry as the Custom Format will handle adding the leading zero for you. Rick "Beebolbod" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What am I missing? | Excel Worksheet Functions | |||
Missing OCX or DLL... | Excel Programming | |||
Who is missing ? | Excel Discussion (Misc queries) | |||
Toolbars Missing, And option to Add Missing | Excel Discussion (Misc queries) | |||
On Error? Creates 1 missing worksheet then never detects any other missing worksheets | Excel Programming |