View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Patti[_5_] Patti[_5_] is offline
external usenet poster
 
Posts: 20
Default One more loop question

Darn, I hate when words wrap when you did not intend them to...please note
that column A only has names. Any other info just wrapped from what I put
in the Columns for L & P.



"Patti" wrote in message
...
I appreciate you hanging in there with me...

1) First, look for first instance of a name in column A

2) Within all rows for that name, look for first instance of either a Null
OR a valid code in column L. To simplify, lets assume my only valid codes
are "THIS" & "THAT". Again, if I find a Null, I don't need to look any
further for that name.

COLUMN A COLUMN L
Jones Cat
Jones THIS '< I need to capture
this for Jones
Smith Dog
Smith Rat
Smith Pig
Smith THAT ' < I need to capture
this for Smith
Smith Rabbit
Thomas '< I don't need

to
look any further for Thomas
Thomas
Thomas

If I find a valid code for a particular name, I need to plunk a comment in
Column P of the row where the first instance of that name appeared, then

go
on to the next name. The output would then look like

COLUMN A COLUMN L COLUMN P
Jones Cat "I
found THIS"
Jones THIS
Smith Dog "I
found THAT"
Smith Rat
Smith Pig
Smith THAT
Smith Rabbit
Thomas
Thomas
Thomas

I won't be able to check back until morning...

You're awesome Bob!


"Bob Phillips" wrote in message
...
"Patti" wrote in message
...
But are we talking about the first row with a valid code, or just

the
first
row for the name?

Always to the first row for the name... I'm moving the data I need to

the
first row for each name. In the end, duplicate rows will be deleted,

so
all
info needs to be on the first row for that name.

I'm just not explaining myself well. Should be once I find a valid

code
OR
a NULL. I real life, when I find a NULL, I just want to set FoundFlag

to
True so that it will END SELECT and go on to the next AgtName. In the

test
loop, I am writing a comment in column P when NULL is found purely so

that
I
can see that it is working.


We don't seem to be connecting. Those two statements above seem to be at
odds to me. The first says pick up the first instance of a name, the

second
says pivck up the firtgs instance of a valid code. They may not be the

same
row. Map out some (good) exsample data, and expected results.

That much I know ; ) I would have thought it'd be adaptable

though.
I know you provided alternate code that doesn't skip a row, but as I

said,
it only find a valid code OR Null ( my "FoundFlag") if appears in the

same
row as the first instance of the name. This won't always be the

case...

If we can get to the stage when I understand what the requirement is I

will
try and do that.