Search : in
By :

Macro comparing two columns

Last answer on May 28, 2009 9:43:39 am BST RoundOrange, on May 26, 2009 8:58:23 pm BST 
 Report this message to moderators

Hello,
I am trying to compare two entire columns in excel, Column A and Column B. If any cell in column A= Lead and any corresponding cell in column B is > .01 – I would like for the numbers in the corresponding column B to turn red. I would also like for this to be easily changed to search for other criteria or encompass them all. I am not sure how to go about this problem and would greatly appreciate any advice.

Configuration: Windows XP Internet Explorer 7.0

Best answers for « Macro comparing two columns » in :
Excel – Comparing cell A1 to entire A column in Sheet 2 ShowExcel – Comparing cell A1 to entire A column in Sheet 2 Issue Solution Note Issue I have been trying to compare sheet1 A2 to sheet2 A2 through A500 and if it exists somewhere in sheet2's a col then copy that entire row to a new sheet....
Comparing the contents of two folders ShowComparing the contents of two folders Under XP, it is possible to integrate a function that allows you to compare the contents of two folders. This may be useful when dealing with folders containing a lot of files and that you...
EXCEL: The INTERSECTION function ShowEXCEL: The INTERSECTION function You have a table consisting of rows and columns. Want to know the value of the cell at the intersection of a particular row / column in your table Example: Your table: - starts C3 to F3 ... for...

1

mubashir aziz, on May 28, 2009 7:00:41 am BST

Do you mean to say that both adjacent cells in column A & B > 0.1 turn B Red ????? Mean if and(A1>.01,B1>.01) then make cell B1 Red . if any of the condition if false then do nothing ..... Even if they are equal then will not work ....

simply put this formula in Conditional Formatting =AND(A1>0.01,B1>0.01). Make sure you are in Cell B1 .... if you want to apply whole column then select first Cell in B column and by pressing Shit or any method selected the last select of B and apply this formula =AND(A1>0.01,B1>0.01)





Never ashamed to get or give Advise.
Muhammad Mubashir Aziz , Lodhran

Reply to mubashir aziz

2

Excelguru, on May 28, 2009 7:31:16 am BST

Hi

Instead of a macro, try conditional formatting
Select cell B1 and apply conditional formatting with formula =and(A1="Lead",B1 > .01) and color formatting to Red


Do let me know If it helps... Winners are losers who got up and gave it one more try. -Dennis DeYoung
My Interests are financial Modelling and custom excel development.

Reply to Excelguru

3

 mubashir aziz, on May 28, 2009 9:43:39 am BST

Sorry my mistake just replace the >.01 in A1 with ="lead"

and(A1>.01,B1>.01)

=AND(A1="Lead",B1 > .01)


Never ashamed to get or give Advise.
Muhammad Mubashir Aziz , Lodhran

Reply to mubashir aziz