hi Gurus...LOL
I have a plan that sums my production per colors, works, but it is like this:
job.......due .................cut......qty
Job1.....22/09.................18/09......
job2.....22/09..................19/09.....
job3....22/09...................19/09.....
job4....22/09...................18/09.....
job5....22/09...................19/09.....
after rum the macro, I got as answer obvious green 55, red 70
but this is not an accurate result, the job was due for the same day, but was produced in different days (18 & 19)
that is a way to separate by date? maybe insert a sumif to compare dates? to have something like this:
Cut.........18/09....19/09
Green.......25.........30
Red.........30.........40
tkx for help me
Leandro Jorge
using the following funcion:
Function SumByColor(CellColor As Range, SumRange As Range)
Dim myCell As Range
Dim iCol As Integer
Dim myTotal
iCol = CellColor.Interior.ColorIndex
For Each myCell In SumRange
If myCell.Interior.ColorIndex = iCol Then
myTotal = WorksheetFunction.Sum(myCell) + myTotal
End If
Next myCell
SumByColor = myTotal
End Function
I have a plan that sums my production per colors, works, but it is like this:
job.......due .................cut......qty
Job1.....22/09.................18/09......
job2.....22/09..................19/09.....
job3....22/09...................19/09.....
job4....22/09...................18/09.....
job5....22/09...................19/09.....
after rum the macro, I got as answer obvious green 55, red 70
but this is not an accurate result, the job was due for the same day, but was produced in different days (18 & 19)
that is a way to separate by date? maybe insert a sumif to compare dates? to have something like this:
Cut.........18/09....19/09
Green.......25.........30
Red.........30.........40
tkx for help me
Leandro Jorge
using the following funcion:
Function SumByColor(CellColor As Range, SumRange As Range)
Dim myCell As Range
Dim iCol As Integer
Dim myTotal
iCol = CellColor.Interior.ColorIndex
For Each myCell In SumRange
If myCell.Interior.ColorIndex = iCol Then
myTotal = WorksheetFunction.Sum(myCell) + myTotal
End If
Next myCell
SumByColor = myTotal
End Function