Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What am I missing? barrett Excel Worksheet Functions 2 May 15th 07 04:38 PM
Missing OCX or DLL... Pierre Archambault Excel Programming 0 September 15th 06 09:17 PM
Who is missing ? lutra Excel Discussion (Misc queries) 6 May 27th 06 09:39 PM
Toolbars Missing, And option to Add Missing SmeetaG Excel Discussion (Misc queries) 3 October 19th 05 11:43 AM
On Error? Creates 1 missing worksheet then never detects any other missing worksheets Craigm[_35_] Excel Programming 2 August 1st 05 02:39 PM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"