Running Sum?
Run this macro and you'll get your desired result. You may need to adjust
the locations.
Sub GetUPL()
Dim UPL As Double
Dim CumIt As Double
Dim Found As Integer
Cells.Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Let UPL = Cells(2, 5).Value 'this is the value you wish to work up to
Let X = 4 'this is the first row of your 10 rows of data
For Y = 2 To 5
For X = 4 To 13
Let CumIt = CumIt + Cells(X, Y)
If CumIt = UPL Then
Found = 1
Exit For
End If
Next
If Found = 1 Then Exit For
Next
If Found = 1 Then
Cells(X, 5).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
End Sub
"RichieK" wrote:
W/O 10 UPL 330
Product Pass 1 Pass 2 Pass 3 Pass 4 Total W/O's
10 10 10 10 10 4
20 10 10 10 10 4
30 10 10 10 10 4
40 10 10 10 10 4
50 10 10 10 10 4
60 10 10 10 10 4
70 10 1
80 10 10 10 10 4
90 10 10 2
100 10 10 10 10 4
100 90 80 80
Hi all
I need some help with a spreadsheet.
I have data arranged in columns that will typically be values of ten. Based
on some other criteria the cell will or will not contain the value ten after
successive passes. What I want to do is tally up to a predetermined value
(UPL) and have an operator tell at a glance (maybe colored cells or
something) where to stop. So in the example included, the operator would
pull all work orders for the first three columns since the total is 260. I
would like to have a visual indicator that tell them to then work down the
Pass 4 column until 330 is reached €“ in this case the final three units of
ten would not need to be pulled.
The next day it may be all of the first three columns and the first three of
the fourth column. Any ideas for a quick fix on this?
|