Count cells by weekdays
Macro Title:
|
Worksheet Variable:
|
Worksheet Name:
|
Range Reference:
|
Weekday:
enter the cell reference that captures the value that represents the weekday that you want to count for |
Output Cell:
|
First Comment:
' |
Second Comment:
' |
Sub Count_cells_by_weekdays()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells by weekdays
ws.Range("D16").Formula = "=SUMPRODUCT(--(WEEKDAY(B5:B11,2)=C16))"
End Sub
Sub Count_cells_by_weekdays()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells by weekdays
ws.Range("D16").Formula = "=SUMPRODUCT(--(WEEKDAY(B5:B11,2)=C16))"
ws.Range("D16").Formula = "=SUMPRODUCT(--(WEEKDAY(B5:B11,2)=C16))"
End Sub