setting VBA code for count of a variable range (1 Viewer)

skkakkar

Registered User.
Local time
Tomorrow, 02:38
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

  • count_on_macro_from_another_table_310715.zip
    16.1 KB · Views: 64

Isskint

Slowly Developing
Local time
Today, 22:08
Joined
Apr 25, 2012
Messages
1,302
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

Top Bottom