Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help debug loop?

Status
Not open for further replies.

VulcanJedi

Technical User
Oct 2, 2002
430
US
Can someone please help, I don't understand what is wrong with this code.... the inner loop doesn't execute at all, debugging by stepping through code goes from the inner For loop directly to the outer NEXT ?)

Nothing in in loop u runs at all?

For y = 0 To (numWks - 1)
For u = 1 To numJobs
If mainsht.Cells(8 + (6 * u), wkStart + 1 + y) = "" Then
'only baseline schedule
WkSum(y) = WkSum(y) + mainsht.Cells(7 + (6 * u), wkStart + 1 + y)
Else
WkSum(y) = WkSum(y) + mainsht.Cells(8 + (6 * u), wkStart + 1 + y)
End If

ActSum(y) = ActSum(y) + mainsht.Cells(9 + (6 * u), wkStart + 1 + y)
Next u
Next y
 
My first thought is that numjobs hasn't been given a value.
 
thanks kylua, actually I figured it out finally I didn't realize that the value wasn't correct, I negected to notice that the derivative of numJobs had changed slightly completely throwing things off. thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top