Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Trouble increasing the array number and capacity?

Sorry for my mistake:
Column A is used for marking with "X" thus The names are in column B, exam
points in C, and 1st, 2nd and 3th coices are in columns D, E, F
respectively.
J_J


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trouble increasing the array number and capacity?

Near as I can tell the problem is you misspelled lngcol by using an "I"
instead of an "L"

Select Case rngCell(1, IngCol).Value


however, even if IngCol has a value of 0, it shouldn't raise an error:

set rngCell = Range("C10")
? rngCell(1,0).Address
$B$10



--
Regards,
Tom Ogilvy

"J_J" wrote in message
...
Sorry for my mistake:
Column A is used for marking with "X" thus The names are in column B, exam
points in C, and 1st, 2nd and 3th coices are in columns D, E, F
respectively.
J_J




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Trouble increasing the array number and capacity?

Hi Tom,
I wish that would have been the reason. But it ain't.
I typed it wrongly when I was typing the follow-up question here.
On the file "lngcol" is typed with an "L" not an "I".
I am stuck.
I am uploding the file to my website with the name "distribute.xls" Here is
the link:
http://www.eserceker.com/xls/distribute.xls
I' ll be more then happy if you or any expert interested here will give it a
try.
Sorry for the non-english language used in the file. But it is straight
forward. Only one button available on Sheet1 to execute all macros...
Sincerely
J_J


"Tom Ogilvy" wrote in message
...
Near as I can tell the problem is you misspelled lngcol by using an "I"
instead of an "L"

Select Case rngCell(1, IngCol).Value


however, even if IngCol has a value of 0, it shouldn't raise an error:

set rngCell = Range("C10")
? rngCell(1,0).Address
$B$10



--
Regards,
Tom Ogilvy

"J_J" wrote in message
...
Sorry for my mistake:
Column A is used for marking with "X" thus The names are in column B,
exam
points in C, and 1st, 2nd and 3th coices are in columns D, E, F
respectively.
J_J






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Trouble increasing the array number and capacity?

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

"J_J" wrote in message
...
Hi Tom,
I wish that would have been the reason. But it ain't.
I typed it wrongly when I was typing the follow-up question here.
On the file "lngcol" is typed with an "L" not an "I".
I am stuck.
I am uploding the file to my website with the name "distribute.xls" Here is
the link:
http://www.eserceker.com/xls/distribute.xls
I' ll be more then happy if you or any expert interested here will give it a
try.
Sorry for the non-english language used in the file. But it is straight
forward. Only one button available on Sheet1 to execute all macros...
Sincerely
J_J


"Tom Ogilvy" wrote in message
...
Near as I can tell the problem is you misspelled lngcol by using an "I"
instead of an "L"

Select Case rngCell(1, IngCol).Value


however, even if IngCol has a value of 0, it shouldn't raise an error:

set rngCell = Range("C10")
? rngCell(1,0).Address
$B$10
Regards,
Tom Ogilvy

"J_J" wrote in message
...
Sorry for my mistake:
Column A is used for marking with "X" thus The names are in column B,
exam
points in C, and 1st, 2nd and 3th coices are in columns D, E, F
respectively.
J_J


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Trouble increasing the array number and capacity?

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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Trouble increasing the array number and capacity?

J_J,

Yes, as you have only 125 students, but would have (9 * 20) 180 capacity.
You probably ought to exit when either all the students are assigned or
the column limit is reached.

Also, I strongly suggest you put Option Explicit at the top of each module.

In addition...
The "Sub SIRALA()" belongs in either module1 or module2, not the Sheet1 module.

Using Application.ScreenUpdating = False at the beginning of your code and
Application.ScreenUpdating = True at the end will speed things up a little.

Regards,
Jim Cone
San Francisco, USA


"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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Trouble increasing the array number and capacity?

J_J,

More comments...

I should also have recommended "Sub Doldur()" to be in a general module.

Also, check the point qualification limits, for example...
Case Is Range("L17").Value '50
means the student must have a point value of 51 or more, not 50

Regards,
Jim Cone


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

Yes, as you have only 125 students, but would have (9 * 20) 180 capacity.
You probably ought to exit when either all the students are assigned or
the column limit is reached.

Also, I strongly suggest you put Option Explicit at the top of each module.

In addition...
The "Sub SIRALA()" belongs in either module1 or module2, not the Sheet1 module.

Using Application.ScreenUpdating = False at the beginning of your code and
Application.ScreenUpdating = True at the end will speed things up a little.

Regards,
Jim Cone
San Francisco, USA


  #8   Report Post  
Posted to microsoft.public.excel.programming
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








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Trouble increasing the array number and capacity?

Tom,
Good point there. Yes I did the modification, increased the number of depts
and had no problems...
Thank you again for your help.
J_J


"Tom Ogilvy" wrote in message
...
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










  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Trouble increasing the array number and capacity?

Tom,
Please forgive me keep asking endless follow-ups ...:)
But, is it possible to add students with the same points equal to last
distributed student point to the dept. lists?.
Regards
J_J

"Tom Ogilvy" wrote in message
...
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












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
Increasing number of rows beyond 65K APKEGEL Setting up and Configuration of Excel 3 May 20th 10 07:55 PM
Automatically increasing a number by 1 Dave Excel Discussion (Misc queries) 3 August 23rd 06 11:13 PM
Increasing Number David Excel Discussion (Misc queries) 2 March 8th 06 01:40 PM
Increasing number of columns beyond IV PSandles Excel Worksheet Functions 1 February 22nd 06 04:36 AM
How do I always insert last cell from a increasing array ? Radu Excel Worksheet Functions 1 November 2nd 05 11:07 PM


All times are GMT +1. The time now is 12:38 PM.

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"