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