Conditional Format With A Macro: Command buttom

November 20, 2017 at 05:11:27
Specs: Windows 10
I am trying to apply "Duplicate Cells Conditional Formatting between two columns" from an excel spreadsheet when a command button is clicked. I am currently able to use conditional formatting to do that cell by cell but I need to be able to do this by the click of a command button on the worksheet.

¿Could you hell me please?

Ana López Luengo

See More: Conditional Format With A Macro: Command buttom

Report •

November 20, 2017 at 05:22:32
Are you checking if the cells adjacent to another is a duplicate?


         A          B          C          D
1       1          1
2       34         6
3       22         22
4       6           8

If you consider the above data, if I was comparing cell by cell column A and column B, then Cells

A1 and B1,  A3 and B3 will be duplicates. 

is this what you want to achieve? if you find duplicates what do you want to do? color both cells?

Report •

November 20, 2017 at 05:45:11
I have created an image explaining what I need...but how do I upload it here?

Report •

November 20, 2017 at 06:35:21
You cannot upload it here you will have to upload to sites such a zippyshare

I do not have access to zippyshare from where I am, so if you wish to send it to me, I will PM you my email address, but at the same time do upload the image to

Report •

Related Solutions

November 20, 2017 at 09:08:00

Report •

November 22, 2017 at 04:22:09
Have you been able to solve it?

Report •

November 22, 2017 at 04:41:51
I don't quite understand the requirement from your email, I need you to explain it properly in details step by step, explain it here so that others can have a go

Report •

November 22, 2017 at 04:53:02
mmm the problem is that the best way to solve it with the excel with you ...anyway, I will try again:

What I want to do is:
I have several columns with different subjets (Diff Eq, Algebra, ....)
In each column, I have the STUDENT ID of those students that have signed up for that subject (ie 20170234, 20179876....

I have created a matrix where each cell refer to the number or students taking the subject i and subject j (for example, the number of students taking Diff Eq and Algebra is 9).

This matrix was done applying the SUMPRODUCT(COUNTIF()) for each pair of columns. So if the same STUDENT ID is in both columns, that students is taking both subjects

For each cell of the matrix calculated, I want to click on it (that is why I am considering implementing a buttom on them), and when clicking, I want to “color” those students that are taking both subjets (the ones duplicated basically)

Thanks again for your help.

Report •

Ask Question