PDA

View Full Version : Compare multiple Cell values between two columns.



staycool
11-24-2008, 06:53 AM
Hi All,

I need to get compare the multiple values of column A and with values in column B in excel sheet and replace the values with blank when hit is found between Column A and Column B.Can u help me with ExcelVBA?
Is there any possiblity to use Vlookup option for this?

Please help me out.
:help

Bob Phillips
11-24-2008, 07:07 AM
Bit more info needed.

What do you mean by multiple values?

What do you mean by hit between A and B?

etc.

staycool
11-25-2008, 12:33 AM
Hit here refers when a match is found.

GTO
11-25-2008, 12:45 AM
Greetings staycool,

Please help us help you. "Hit here refers to when a match is found" is simply not descriptive enough. Please be cognizant that only you know what is is exactly that you want to accomplish. For instance, when a matching value is found in col A and col B, are both erased or just one? If just one, which one? Are we expecting to find only one instance of a givien value in ea column? ...and so on.

See, while you already have in your head exactly what you want to do, we don't.

How about this: attach a small workbook w/example data. 4 columns. A before and after "picture" so-to-speak.

Hope this helps,

Mark

staycool
11-25-2008, 04:24 AM
For E.g,

Comp1 Comp2
A B
B C
A C
A A
C B

Now i need an output like below after running the VBA,
Comp1 Comp2
NULL NULL
NULL NULL
A C
A NULL
NULL B

I hope u understood.

staycool
11-25-2008, 05:20 AM
For E.g,

Comp1 Comp2
A B
B C
A C
A A
C B

Now i need an output like below after running the VBA,
Comp1 Comp2
NULL NULL
NULL NULL
A C
A NULL
NULL B

I hope u understood.

GTO
11-25-2008, 06:04 AM
Are you trying to say:

For ea row in col 1...

IF there is a like value in col 2, EXCEPTING this row in col 2, then, this row in col 1 is null... else, val=val

Mark

staycool
11-25-2008, 06:09 AM
S.U r right.But a small change is that i need both col1 and col2 to be made as NULL.that too value in Col2 has to be definetely made NULL when there is actually an entry in Col1.