Count cells if weekends
Macro Title:
|
Worksheet Variable:
|
Worksheet Name:
|
Range Reference:
|
Number representing first day of the weekend (Saturday):
|
Output Cell:
|
First Comment:
' |
Second Comment:
' |
Sub Count_cells_if_weekends()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells if weekends
ws.Range("E8").Formula = "=SUMPRODUCT(--(WEEKDAY(B8:B14,2)>=C5))"
End Sub
Sub Count_cells_if_weekends()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells if weekends
ws.Range("E8").Formula = "=SUMPRODUCT(--(WEEKDAY(B8:B14,2)>=C5))"
ws.Range("E8").Formula = "=SUMPRODUCT(--(WEEKDAY(B8:B14,2)>=C5))"
End Sub