View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Trouble increasing the array number and capacity?

Don't the choices stop after column F

so when lngcol achieves a value of 7, you have assigned all eligible
students I believe (choices are only through column F). You criteria now
continues on if any department is not filled up.

so your terminating condition should be:

If i < 10 Or j < 10 Or k < 10 Or l < 10 Or m < 10 Or n < 10 Then
lngCol = lngCol + 1
if lngCol < 7 then _
GoTo StartOver
End If

Jim suggested similar, but I don't believe it was as specific.

Increasing department numbers or department capacities should have no effect
if you add this condition.

--
Regards,
Tom Ogilvy


"J_J" wrote in message
...
Jim,
Thank you. You were correct. Now why didn't I think of that?.
Do you think if I increase the Department number from 6 to 9 as described
above and increase dept. capacities around 20 for most of them (which is

the
real case) that doesn't introduce similar problems?
Regards
J_J



"Jim Cone" wrote in message
...
J_J,

You have run out of columns.
RngCell is column C, so lngCol cannot exceed 254...
RngCell(1, 1) is Column 3
RngCell(1, 254) is Column 256

You might try something like this...
If i < 10 Or j < 10 Or k < 20 Or l < 10 Or m < 10 Or n < 10 Then
lngCol = lngCol + 1
If lngCol < 255 Then
GoTo StartOver
End If
End If

Regards,
Jim Cone
San Francisco, USA