Re: Edit Replace command
- From: "Roger Govier" <roger@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 08:54:06 +0100
Hi Steve
You only need a few rows to demonstrate what happens.
With 6 "a"s in each cell, carrying out the Edit/Replace it finds 3 sets
of 2, does the replacement and you are left with 3 a's in each cell.
If you carry out the Edit/Replace again, this time it only finds one
occurrence of a double, which gets replaced with a single, and the
result is 2 a's in each cell.
If you did it a third time, then each pair would get replaced with a
single, and all cells would contain a single a.
The behaviour is the same in all versions of XL including XL2007.
--
Regards
Roger Govier
"SteveT" <dev@xxxxxxxxxxxxx> wrote in message
news:uTZuJcruHHA.4572@xxxxxxxxxxxxxxxxxxxxxxx
I don't think you read my post.
I want to know if anyone is finding Replace replaces all occurrences
or does
just one pass and they have to run it again until all the occurences
are
replaced.
It doesn't matter what the character is. To make this simple type the
letter
a 26 times in every cell of one column (do it once and fill down). I
did it
for 30,000 rows.
Choose Edit Replace
Find what: aa
Replace with: a
and click Replace All
On my system there will be more than one a left in each cell but on
another
person's system they will only have one a left in each cell.
I believe in Excel 2000 you had to run it more than once.
I may have a system problem but I would like to know what other people
are
finding, if anyone could do a test.
Thanks,
Steve
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote
in
message news:Oep1yGnuHHA.4868@xxxxxxxxxxxxxxxxxxxxxxx
WithI have someone who's Replace command replaces everything in one
pass.
passmine however I have to repeat the process. This is Excel 2003
An example is lets say you want to replace all occurrences of two
spaces
with one. The first time the Replace command is run it only makes
one
Ifremoving only the first found two spaces in each cell. I have to
run the
command several times to replace all occurrences. But the other
person
only has to run it once.
What is the other person replacing and what is he/she replacing it
with?
you wanted to replace every occurrence of a double space withthat
something
does not contain a space in it, then one pass is enough. The problemThe
you
describes does not take into account an odd number of contiguous
spaces.
replacement of each pair leaves multiple spaces next to each other atwhat
the
end. Why? Because Replace is not reentrant (it doesn't look back to
see
it just created)... it simply looks for the double, space, replacesand
it,
moves on to the next piece of text after the text it has just
operated on.
Rick
.
- References:
- Edit Replace command
- From: smxdev
- Re: Edit Replace command
- From: Rick Rothstein \(MVP - VB\)
- Re: Edit Replace command
- From: SteveT
- Edit Replace command
- Prev by Date: Re: Excel 2003 Pivot Tables / Running Totals
- Next by Date: Importing a CSV File and using a Conditional Statement and Row delete?
- Previous by thread: Re: Edit Replace command
- Next by thread: viewing problem in Excel
- Index(es):
Relevant Pages
|