LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to count items depending on attributes in VBA

Hello
I have a table
Each line is about a window and its attributes.
One of the attributes is the floor on which the window is installed and an other is the class (1-5) of the window
What I need to do is: I want to count the windows on each floor from floor 1-x and depending on its class.
So the table looks like that:


Window
Number floor class
1 1 1
2 1 1
3 2 3
4 2 3
5 2 2
.. . .
.. . .
.. . .

So the result should be :
2 Windows on floor 1 with class 1
2 Windows on floor 2 with class 3
1 Window on floor 2 with class 2
and so on...... for the other floors

in VBA

I tried the function dcount but did not succeed because the criteria should not be in the table
and I dont know how to loop it..
Dim winClass1 as long
winClass1 = Application.WorksheetFunction.DCountA(Range("A:F") , 2, Range("H1:J2"))

Thank you very much for any help!

MIchael


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMPRODUCT to count items with duplicates where another column contains two defined items PCLIVE Excel Worksheet Functions 4 September 8th 07 10:33 AM
Data value display attributes linked to table attributes MDT at Paragon Home Inspections, LLC Charts and Charting in Excel 0 November 15th 06 12:53 AM
How to count and group items in a list depending on size of list? Simon Lloyd[_859_] Excel Programming 3 August 13th 06 12:18 AM
How to count items in a list and group depending on size of list? Simon Lloyd[_712_] Excel Programming 5 April 28th 06 12:14 AM
Count rows with specific attributes in VBA Steve Newhouse Excel Worksheet Functions 3 February 25th 06 01:30 AM


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright İ2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"