VBA question

crazyowl86

New Member
Joined
Jun 1, 2022
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
I have two sheets. On sheet one, column B starts from row 6 with a list of dates. On sheet two, column D starts from row 2 with another list of dates. I am trying to create a macro that highlights the whole row starting from column D in sheet one if there is a match between the dates in sheet one and sheet two. Can anyone help me with this? I would greatly appreciate any advice or help.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Any reason this has to be VBA? It could be done easily with conditional formatting.
 
Upvote 0
Just because there are cells constantly being added to and deleted from this file, I thought using VBA might just automate the process.
 
Upvote 0
I am still unclear as to why you can't use conditional formatting for this.

On sheet one, column B starts from row 6 with a list of dates. On sheet two, column D starts from row 2 with another list of dates. I am trying to create a macro that highlights the whole row starting from column D in sheet one if there is a match between the dates in sheet one and sheet two. C

Select all columns to be highlighted on sheet one and apply this rule:

Excel Formula:
=AND(ROW()>=6,ISNUMBER(MATCH($B1,'sheet two'!$D:$D,0))

This will be impervious to rows being added and deleted.
 
Upvote 0

Forum statistics

Threads
1,224,938
Messages
6,181,870
Members
453,068
Latest member
DCD1872

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