Count cells with specific value in even columns
Macro Title:
|
Worksheet Variable:
|
Worksheet Name:
|
Range Reference:
|
Specific Value:
cell reference where the specific value is captured |
Output Cell:
|
First Comment:
' |
Second Comment:
' |
Sub Count_cells_with_specific_value_in_even_columns()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells with specific value in even columns
ws.Range("K8").Formula = "=SUMPRODUCT(--(MOD(COLUMN(C8:I8),2)=0),--(C8:I8=C5))"
End Sub
Sub Count_cells_with_specific_value_in_even_columns()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count cells with specific value in even columns
ws.Range("K8").Formula = "=SUMPRODUCT(--(MOD(COLUMN(C8:I8),2)=0),--(C8:I8=C5))"
ws.Range("K8").Formula = "=SUMPRODUCT(--(MOD(COLUMN(C8:I8),2)=0),--(C8:I8=C5))"
End Sub