View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Sorry, Mistake!

I'm jumping in again!

For each cell in column A, check to see if matches a value in column B (any
value--not just the same row!).

And if it matches, then take the corresponding value from C (on the matched row
and copy it to the cell in column A.

A B C
aaa aac x
aab bbb y
aac aaa z
aad bbc w

So for aaa, I'd see a match in row 3 and use Z in column A.
For aac, I'd see a match in row 1 and use x in column A.

A B C
z aac x
aab bbb y
x aaa z
aad bbc w

If this is true, then I'm going to suggest a different approach.

Insert a new column B (shifting B&C to C&D)
Insert this formula in B1.
=IF(ISERROR(VLOOKUP(A1,$C$1:$D$99,2,FALSE)),A1,VLO OKUP(A1,$C$1:$D$99,2,FALSE))

Adjust the ranges to match your data (and start in the correct row).

If you change anything in column A, then column B will fix itself with the nex
calculation.

If you don't want to see column A, then you can hide it.

If this were a one-time shot (you never need to do it again), then convert
column B to values and delete column A. (one way to convert to values:
copy|Paste special|Values)



SolaSig AB wrote:

Oopps!

Wrote:
It mean IF Value in A1 Matches Value in B1 then Value in A1 will be changed
with Value in _C3_, but in real life there is not so simple because Value
for
A1 may match only Value in B3 and then Value in A1 have to be changed from
C3 Value.

Have to write:
It mean IF Value in A1 Matches Value in B1 then Value in A1 will be changed
with Value in _C1_, but in real life there is not so simple because Value
for
A1 may match only Value in B3 and then Value in A1 have to be changed from
C3 Value.

Andre

"SolaSig AB" wrote in message
...
Dave, thanks for your Help with whole Sub, and thanks to Don for original
idea this really works!
(Problem was as I see only in my poor knowledge of VBA)

Now I'll try to make this Sub to work for whole B Column.
As I see Value in Cell A will be changed only if Value in Cell B matches,
but the Row have to be the same also!
It mean IF Value in A1 Matches Value in B1 then Value in A1 will be

changed
with Value in C3, but in real life there is not so simple because Value

for
A1 may match only Value in B3 and then Value in A1 have to be changed from
C3 Value.

Original text is much more complex there is 25.000 Rows and 15 Columns.

(375
000 Cells) I will try to make all Columns separate, if this will work for

a
single column.
In this single column data is been repeated some times so amount of cells

in
Single "A" column will be 25 000, and amount of Cells in B and C columns
will be only about 5 000 cells per column, and cell's B Value does not
correspond to A Value in current Row in 99,99% of cases.

As I already wrote on 23rd 08 2003:

It works for

RED RED R
BLUE BLUE B



But not for

RED BLUE B
Dave thanks for your Help with whole Sub, and thanks to Don for original
idea this really works! (Problem was as I see only in my poor knowledge of
VBA)

Now I'll try to make this Sub to work for whole B Column.
As I see Value in Cell A will be changed if Value in Cell B matches, but

the
Row have to be the same also! It mean IF Value in A1 Matches Value in B1
then Value in A1 will be changed with Value in C3, but in real life there

is
not so simple because Value for A1 may match only Value in B3 and then

Value
in A1 have to be changed from C3 Value.

Original text is much more complex there is 25.000 Rows and 15 Columns.

(375
000 Cells) I will try to make all Columns separate, if this will work for

a
single column. In this single column data is been repeated some times so
amount of cells in Single A column will be 25 000, and amount of Cells in

B
and C columns will be only about 5 000 cells per column, and cell's B

Value
does not correspond to A Value in current Row.

As I already wrote on 23rd 08 2003:

It works for

RED RED R
BLUE BLUE B



But not for

RED BLUE B
BLUE RED R
BLUE
RED
BLUE
RED
RED
BLUE

Have you any Idea how to make it work?

Thanks again in advance for your patience and help!

Andre



--

Dave Peterson