setting VBA code for count of a variable range

skkakkar

Registered User.
Local time
Today, 21:18
Joined
Jul 18, 2015
Messages
16
Hi,
1. I have a sample database table in excel where depending on column 2 value >1 is checked and logical results by IF check placed in Column D. The values having "Y" in column D are placed in Columns E:F.
2. Now I want to place count of values meeting the condition on last cell of the filled E:F range.
3. VBA code written by me proceeds fine and places values meeting condition in column E:F
4. I am beginner to VBA and finding difficulty in proper code for placing sum of counts of acceptable values in range F2:F7 in cell F8 ie last value in the array. Presently I have placed the value by In-built Count function in Excel.
Request help in this minor problem.
File Count on Macro from another table is attached pl.
 

Attachments

hi skkakkar,

This post should be in the Excel section, perhaps a mod will move it?

To answer however, you need this line of code after generating your list
Code:
ActiveCell.FormulaR1C1 = "=COUNT(R[-" & Counter1 - 2 & "]C:R[-" & Counter1 & "]C)"
 

Users who are viewing this thread

Back
Top Bottom