Excel Macro to find out what day of the week today

I would like to create a macro that will look at what day of the week today (Monday, Tuesday, Wednesday, etc.), and if the day is Saturday or Sunday, the macro will simply stop everything except if it is the day of the week (M, T, W, Th or F), then it is called by the next Sub.

Private Sub Workbook_Open()
    **If today is Saturday or Sunday Then**
        **do nothing**
        Else
        Call Populate_Workbook()
      End If
End Sub

parts with ** are those parts that I need to find out. If someone finishes figuring this out, can you explain how you came to the decision? Trying to learn and understand macros more.

+4
source share
1 answer

Here you go ...

Private Sub Workbook_Open()
    If Weekday(Date, vbMonday) < 6 Then Populate_Workbook
End Sub

Weekday() , , . Weekday() 1 7.

6, 7.

+8

All Articles