Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

Divide a list into Groups

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SerpentineFire - 14 May 2008 04:50 GMT
I need divide a list of 500 lines into groups of 8 and assign a number or
name to each group
Joel - 14 May 2008 05:09 GMT
This requires a simple macro.  Do you want a space inbetween each group.  How
do you want to assign a number?  Write the number in column A?  Need a little
more details to get it right.

> I need divide a list of 500 lines into groups of 8 and assign a number or
> name to each group
SerpentineFire - 14 May 2008 16:05 GMT
No space needed.  I have 500 lines that i need evenly divided in to 8 groups.
So line 1-62 is assigned group 1 (or # 1)  63-124 group 2 and so on...  The
group number would be in Column A.  Hope this is enough Details

> This requires a simple macro.  Do you want a space inbetween each group.  How
> do you want to assign a number?  Write the number in column A?  Need a little
> more details to get it right.
>
> > I need divide a list of 500 lines into groups of 8 and assign a number or
> > name to each group
Joel - 14 May 2008 18:08 GMT
Sub number_groups()

Const NumLines = 500
Const NumGroups = 8

GroupSize = Int(NumLines / NumGroups)

GroupNum = 1
For Lines = 1 To NumLines
  GroupNum = WorksheetFunction.RoundUp(Lines / GroupSize, 0)
  Range("A" & Lines) = GroupNum
Next Lines

End Sub

> No space needed.  I have 500 lines that i need evenly divided in to 8 groups.
>  So line 1-62 is assigned group 1 (or # 1)  63-124 group 2 and so on...  The
[quoted text clipped - 6 lines]
> > > I need divide a list of 500 lines into groups of 8 and assign a number or
> > > name to each group

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.