Converting Countifs formula to VBA

Mohammed Waseem

New Member
Joined
Dec 11, 2017
Messages
1
Dear Reader,

How I can write VBA program - I am beginner.

I had created an excel sheet with two sheets "Sheet 1 for filling reporting the data" "Sheet 2 for counting the filled or reported data".

I had used following formula - =COUNTIFS('EHS Walk & Talk Report Status'!B2:B1000,"W1",'EHS Walk & Talk Report Status'!C2:C1000,"Oct",'EHS Walk & Talk Report Status'!D2:D1000,"FY17-18",'EHS Walk & Talk Report Status'!M2:M1000,"B # 25",'EHS Walk & Talk Report Status'!O2:O1000,"Outstanding")

Criteria range will remains the same but criteria will change like following

WeeksMonthsFiscal YearBudget UnitsRemarkscondition
W1OctFY 17-18B # 25OutstandingUnsafe Act
W2Nov B # 50RectifiedUnsafe Condition
W3Dec B # 51 & 81 Rectified
W4Jan B # 52 Outstandings
W5Feb B # 52-HGPR Good Practice
Mar B # 60
Apr B # 61
May MFS- Tool Depot
Jun B # 72
Jul B # 73
Aug B # 75
Sep B # 76
B # 77
B # 79
B # 80
B # 90
B # 92
Al Majal
All Dept
PS CD

<tbody>
</tbody><colgroup><col span="2"><col><col><col><col></colgroup>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the Board!

You can use COUNTIFS in VBA, you just call it like this:
Code:
Application.WorksheetFunction.Countifs(...)
 
Upvote 0

Forum statistics

Threads
1,215,504
Messages
6,125,185
Members
449,213
Latest member
Kirbito

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