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: 1
Default How to count items in a list and group depending on size of list?


Hi all,

I would like to be able to count the amount of entries in column C an
depending on the amount group in either groups of 3 or 4, all name
would be unique......so if there are 14 names in the list they woul
need to be grouped in to two groups of 4 and two groups of 3, if ther
were 19 then 4 groups of 4 and 1 group of 3 etc to a maximum 50 people
the results could appear on a seperate worksheet.

Below is how i generate the list of people and then randomise them an
display the result (i have only used up to 24 in this test, the name
come from sheet2 in my workbook)

Hope someone can help.......it seems very complex to group all th
permutations!

Simon.

Option Explicit
Sub numberrand()

Call Players

Range("a1").Formula = "1"
Range("a2").Formula = "2"
Range("A1:A2").AutoFill Range("A1:A24")
Range("b1").Formula = "=RAND()"
Range("b1").AutoFill Range("B1:B24")
Range("B1:B24").Select
Columns("B:B").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Rows("1:24").Select

Selection.Sort Key1:=Range("B1"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("b:b").Delete
Range("a1").Select
Call ListShow

End Sub
Sub Players()
Application.Goto Reference:="Players"
Selection.Copy
Sheets("Draw Order").Select
Range("D1").Select
ActiveSheet.Paste
End Sub
Sub ListShow()
Range("A1:E40").Select
Selection.Copy
Sheets("Results").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Call SkipBlanks

End Sub
Sub SkipBlanks()
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="<"

Call ClearOrder
End Sub

Sub ClearOrder()
Sheets("Draw Order").Select
Range("A1:E40").Select
Selection.ClearContents
Range("A1").Select
Sheets("Results").Select
End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=53546

 
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 can I count items in a filtered list? Counting filtered data. Excel Worksheet Functions 44 April 4th 23 10:22 AM
Group and count a list of dates Jeffshex Excel Worksheet Functions 0 August 28th 07 05:08 PM
Count items on the list dannyboy213 Excel Discussion (Misc queries) 5 February 2nd 06 08:12 PM
is it possible to re-size or format list items in dropdown box? jc Excel Discussion (Misc queries) 1 August 14th 05 12:01 AM
How can i change the font size of the items in a list Kiran Excel Discussion (Misc queries) 1 June 15th 05 11:07 PM


All times are GMT +1. The time now is 10:09 AM.

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"