countif using vba

biggercrap

New Member
Joined
Dec 8, 2006
Messages
48
How am I going to count column 'A' contain # and column 'E' contain the word AT using VBA?

e.g Below occurence is 2 (highlight in red)

A B C D E
1 1x AT
2 2
3 3# AT
4 4a
5 5i AT
6 6 AT
7 7 AT
8 8# AT
9 9#
10
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Which version of Excel?
 
Upvote 0
You could use:
Code:
Evaluate("SUMPRODUCT(--(ISNUMBER(FIND(""#"",A1:A10)),--(E1:E10=""AT""))")

if you really need VBA.
 
Upvote 0
Hi,
There is still error. Why do we need to use evaluate?

Hi there,

I believe just a minor typo/one missing parenthesis:

Code:
Evaluate("SUMPRODUCT(--(ISNUMBER(FIND(""#"",A1:A10))),--(E1:E10=""AT""))")
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,626
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top