Find Saturday and Sunday

boldcode

Active Member
Joined
Mar 12, 2010
Messages
347
Hello,

I have a spreadsheet that contains date values in cells found within Columns L and M. The first row is reserved for row titles so the dates values actually begin in row 2. I want to create a macro that can highlight cells (fill the cell with color yellow) if the date value is a Saturday or Sunday.

The number of rows change from time to time so I would need a solution that can account for this (something along the lines of L2 to last row in Column M).

Please let me know if something is not clear and thank you very much for your time and attention.

- BC
 
Cant you just use conditional formatting?

Select L2

Conditional Formatting
New Rule
Use a formula to determine...

=(OR(WEEKDAY(L2)=1,WEEKDAY(L2)=7))

Format as required
Use Format painter (paintbrush icon) to copy to other cells
 
Upvote 0
I looked into this and you can make it work that way, but I'm really looking for vba code that can do this. Thanks for your response Special-K99, appreciate it.

- BC
 
Upvote 0

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