rpaulson
Well-known Member
- Joined
- Oct 4, 2007
- Messages
- 1,431
I have a list of people name in column A. starting in cell A1 ,There is anywhere from 10 to 100 names on the list.
I need to assign these people to a class room number (Room A, B, C .....) there may be up to 9 rooms available on any given day.
I am looking for VBA code to assign the people into a room. by putting the room number in column B
I will use:
people= Cells(Rows.Count, "A").End(xlUp).Row 'this will tell me how many people are registered
rooms= inputbox ("How many rooms are available today") 'number of groups to break the list into
I know i could go Down the list and write A,B,C,D then A,B,C,D then A,B,C,D etc... but that is not what i want.
i want the list to go A,A,A,A B,B,B,B, C,C,C,C D,D,D,D, .....
Examples.
43 people and 5 rooms - Room A would have the first 9 people on the list, Room B the next 9, Room C the next 9, Room D then next 8 and Room E the last 8
17 people and 3 rooms - Room A would have the first 6 people on the list, Room B the next 6, Room C the last 5.
49 people and 4 rooms - A would have first 13, B next 12, C next 12, and D last 12
thanks for looking,
-Ross
I need to assign these people to a class room number (Room A, B, C .....) there may be up to 9 rooms available on any given day.
I am looking for VBA code to assign the people into a room. by putting the room number in column B
I will use:
people= Cells(Rows.Count, "A").End(xlUp).Row 'this will tell me how many people are registered
rooms= inputbox ("How many rooms are available today") 'number of groups to break the list into
I know i could go Down the list and write A,B,C,D then A,B,C,D then A,B,C,D etc... but that is not what i want.
i want the list to go A,A,A,A B,B,B,B, C,C,C,C D,D,D,D, .....
Examples.
43 people and 5 rooms - Room A would have the first 9 people on the list, Room B the next 9, Room C the next 9, Room D then next 8 and Room E the last 8
17 people and 3 rooms - Room A would have the first 6 people on the list, Room B the next 6, Room C the last 5.
49 people and 4 rooms - A would have first 13, B next 12, C next 12, and D last 12
thanks for looking,
-Ross