Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Calculate number of records in a Group

Nigel,

Depending in your data, you may be able to use the
CurrentRegion.Rows.Count property

j = ActiveCell.CurrentRegion.Rows.Count

If you know where the first row of any group starts, you can activate
that cell then use the ActiveCell.CurrentRegion.Rows.Count property.

Hope this helps.

Greg


Nigel wrote:
I have data in a spreadsheet that is grouped by Customer and between each
grouping there are 2 blank lines

What I have to do is calculate the sum of the a column (for example Y) so
for the first customer it would be sum(y7:y23) and for the next customer it
would be sum(y26:y30) but when I rerun the data it might be (Y7:y15) and
(y18:y22) and so forth depending on the conditions I apply

Is there any way I can calculate the number of records each grouping
contains, In column B at the top of the group will be the customer name and
in column B at the end of the group the customer name will appear again if
that helps to calculate the number of rows inclusive of the top and bottom
rows


Reply
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
how to calculate with vba the number of records in an excel- table? André Excel Discussion (Misc queries) 5 November 11th 06 01:30 PM
how to calculate with vba the number of records in an excel- table? André Excel Programming 5 November 11th 06 01:30 PM
how to group records in a new worksheet Gunther Excel Worksheet Functions 1 March 1st 06 10:37 AM
how to group records in a new worksheet Gunther Excel Discussion (Misc queries) 1 February 22nd 06 06:59 AM
count duplicate records in a group Mparekh Excel Worksheet Functions 4 December 21st 05 02:10 PM


All times are GMT +1. The time now is 05:16 PM.

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

About Us

"It's about Microsoft Excel"