Using VBA I entered a function (found online) to be used in a cell formula. The function and the formula work, but the cell that contains the formula will not update automatically; Calculations are set to automatic. To make the formula work I have to place my cursor behind the formula and enter.
Excel Version: Microsoft® Excel® for Microsoft 365 MSO (16.0.13029.20342) 64-bit
My formula: =(CheckRegister[[#Totals],[WITHDRAWAL]]-SUMCOLOR(G5,CheckRegister[WITHDRAWAL]))
My UDF Code: Function SumColor(rColor As Range, rSumRange As Range)
Dim rCell As Range
Dim iCol As Integer
Dim vResult
iCol = rColor.Interior.ColorIndex
For Each rCell In rSumRange
If rCell.Interior.ColorIndex = iCol Then
vResult = WorksheetFunction.Sum(rCell) + vResult
End If
Next rCell
SumColor = vResult
End Function
Bookmarks