MyRange.End is moving

P

Pablo Cardellino

Hi,

I have a range called "base".; This range boundaries shouldn't move, because
at the end of one loop its text could change. Within the loop, two inner
ranges are determined trough the base.Duplicate method for performing a
series of processing which includes som find actions. One of these ranges,
called "b" matches a pair of characters ("ôo") which are at the end of base
text ("vôo"). The other inner range, called "c" is used for processing
possible characters between b.End and base.End, such as the "s" in "vôos"
(plural of "vôo", which means "flight"). But within this loop base.Text is
just "vôo", so nothing is found within the c range. After this line of code,
aparently nothing to do with base, base.Text is "v":

b.Text = StrConv(Char, vbLowerCase, 8) ' this changes "ôo" by "oo"

Does somebody knows why?

Thanks in advance,
 
P

Pablo Cardellino

Well,
I've understood why this is happening:

As I have explained, b.End is the same as base.End. The atribution of a new
string to the b.Text property seems to delete the b.Text first, and to
assign the new text in a second moment. In the first moment, when the text
is deleted, the base.End is moved up to b.Start and so base has no more
characters shared with b. So, when b.End is moved in the second moment,
base.End isn't "dragged" together anymore.

Regards,
 

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