Hi all,
I am hoping someone can get me on track.
I have a sheet filled with calculated data, these rows contain times and production rates for those times and each row will be for a different length of time and at a different speed.
I am trying to read that data to a different sheet in hourly groupings for the 24hr day calculating the production rate for each hour which may be comprised of one or two or even 6 different rows and speeds.
With this in mind I have been looking at loops inside loops and cannot seem to get my mind on track with it.
For h = 1 To 24
For i = 1 To noOfRows
startTime = wsSource.Cells(4, 9).Value
qtyPerMin = wsSource(j, 13)
totalRequired = wsSource.Cells(j, 14)
runtime = totalRequired / qtyPerMin
For j = 0 To 60
'There could be several different rows to read in here, but maybe only one.
curCount = curCount + qtyPerMin
Next j
rowCount = rowCount + 1
Next i
Next h
I have dabbled a bit before, probably a bit more experience with VB.NET but worked in VBA here and there so if someone can set me on the right path I should be all over it.
I find it hard to believe someone hasn't had to do something similar at some stage but had no luck finding anything yet.
See attached workbook for before and after examples
Thanks in advance for any help recieved.
hayz33
Bookmarks