Delete entire row if date in column A is a weekend day or holiday

sv1996

New Member
Joined
May 12, 2018
Messages
3
Hi guys,


Do you know how to delete an entire row if the date in column A is a weekend day or holiday? I am still an Excel newbie and am wondering how to do it.

I truly appreciate your help, thank you.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
weekend is easy, for the holidays you have to maintain a calendar listing the holidays within your Country or your Organization
 
Upvote 0
weekend is easy, for the holidays you have to maintain a calendar listing the holidays within your Country or your Organization

HI VBA Geek, thanks for the reply.

The holidays are quite few so I can remove their rows manually. How should I remove the rows for the weekend days (VBA or function)?
 
Upvote 0
if you can use an helper column then enter this formula: =WEEKDAY(A1,2)>5 and delete all the rows that are TRUE
 
Upvote 0
How about using this macro?

<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Sub VenA()
Dim r As Range, cl As Range
For Each cl In Columns(1).SpecialCells(2, 1)
If Weekday(cl, 2) > 5 Then
If r Is Nothing Then Set r = cl Else Set r = Union(r, cl)
End If
Next cl
If Not r Is Nothing Then r.EntireRow.Delete
End Sub</code>
 
Upvote 0
Cross posted https://www.excelforum.com/excel-pr...-in-column-a-is-a-weekend-day-or-holiday.html

Cross-Posting
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
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