Macro comparing two columns

Closed
RoundOrange Posts 1 Registration date Monday 25 May 2009 Status Member Last seen 26 May 2009 - 26 May 2009 à 15:58
mubashir aziz Posts 190 Registration date Sunday 12 April 2009 Status Member Last seen 16 February 2010 - 28 May 2009 à 04:43
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.

3 responses

mubashir aziz Posts 190 Registration date Sunday 12 April 2009 Status Member Last seen 16 February 2010 166
28 May 2009 à 02:00
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)





Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 307
28 May 2009 à 02:31
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...
mubashir aziz Posts 190 Registration date Sunday 12 April 2009 Status Member Last seen 16 February 2010 166
28 May 2009 à 04:43
Sorry my mistake just replace the >.01 in A1 with ="lead"

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

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