Count cells with values in even rows
Macro Title:
|
Worksheet Variable:
|
Worksheet Name:
|
Range Reference:
|
Output Cell:
|
First Comment:
' |
Second Comment:
' |
Sub Count_cells_with_values_in_even_rows()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells with values in even rows
ws.Range("D5").Formula = "=SUMPRODUCT(--(MOD(ROW(B5:B11),2)=0),--(B5:B11<>""))"
End Sub
Sub Count_cells_with_values_in_even_rows()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells with values in even rows
ws.Range("D5").Formula = "=SUMPRODUCT(--(MOD(ROW(B5:B11),2)=0),--(B5:B11<>""))"
ws.Range("D5").Formula = "=SUMPRODUCT(--(MOD(ROW(B5:B11),2)=0),--(B5:B11<>""))"
End Sub