Highlight rows with the same date and appointment time

Bwiles96

New Member
Joined
Apr 5, 2022
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I am looking for a macro to highlight rows that have an appointment that occur on the same day at the same time.
See table below for reference.

04/11/2022
11:00 AM​
04/11/2022
11:00 AM​
04/11/2022
10:00 AM​
04/11/2022
9:00 AM​
04/11/2022
8:00 AM​
04/11/2022
10:00 AM​
04/11/2022
8:00 AM​
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the Board!

If your data is in the range A1:B8, select that rows 1:8, go to Conditional Formatting, select the formula option and enter this formula:
Excel Formula:
=COUNTIFS($A:$A,$A1,$B:$B,$B1)>1
then choose your desired highlighting color.
 
Upvote 0
Solution
Welcome to the Board!

If your data is in the range A1:B8, select that rows 1:8, go to Conditional Formatting, select the formula option and enter this formula:
Excel Formula:
=COUNTIFS($A:$A,$A1,$B:$B,$B1)>1
then choose your desired highlighting color.
Thank you.

If I wanted to highlight the whole row, and also highlight in different colors, would there be a way to do that? Whether that be conditional formatting or vba?
 
Upvote 0
Thank you.

If I wanted to highlight the whole row, and also highlight in different colors, would there be a way to do that? Whether that be conditional formatting or vba?
The method I gave you will highlight the entire row (note I said to "select the entire row"? Whatever is selected will be highlighted).

Unfortunately, Conditional Formatting will not do different colors for different duplicates, unless you were to set up each row manually (which probably isn't feasible with dynamic data).
Even with VBA, I cannot think up of a great way to do it, as you have no idea how many duplicates you will have, so you don't know how many colors you will need.

Perhaps someone else will be able to propose some method.
 
Upvote 0
The method I gave you will highlight the entire row (note I said to "select the entire row"? Whatever is selected will be highlighted).

Unfortunately, Conditional Formatting will not do different colors for different duplicates, unless you were to set up each row manually (which probably isn't feasible with dynamic data).
Even with VBA, I cannot think up of a great way to do it, as you have no idea how many duplicates you will have, so you don't know how many colors you will need.

Perhaps someone else will be able to propose some method.
I appreciate your time Joe.

Would there be a code for to alternate the color regardless? There won't be an insane amount of duplicates, they are mainly flukes or misscheduling on my teams part. I am just trying to get us organized. This happens rarely, so we wouldn't need more than like 5 colors to alternate through.
 
Upvote 0
You are welcome.
I hope you are able to incorporate that to do what you need.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top