I have sum color function in my macro file in separately INEOS PO Calculation Template.xlsm.
I would like to use that function in all open workbook.
How do i enable sum color function in all open workbook please?
Code:
Option Explicit
Function SumColor(MatchColor As Range, sumRange As Range) As Double
Dim cell As Range
Dim myColor As Long
myColor = MatchColor.Cells(1, 1).Interior.Color
For Each cell In sumRange
If cell.Interior.Color = myColor Then
SumColor = SumColor + cell.Value
End If
Next cell
End Function
Second code:
*Also added on the workbook for any cell changes for below code:*
Code:
Private Sub Workbook_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A:ZZ")) Is Nothing Then
End If
ActiveWorkbook.Calculate
End Sub
I would like to use that function in all open workbook.
How do i enable sum color function in all open workbook please?
Code:
Option Explicit
Function SumColor(MatchColor As Range, sumRange As Range) As Double
Dim cell As Range
Dim myColor As Long
myColor = MatchColor.Cells(1, 1).Interior.Color
For Each cell In sumRange
If cell.Interior.Color = myColor Then
SumColor = SumColor + cell.Value
End If
Next cell
End Function
Second code:
*Also added on the workbook for any cell changes for below code:*
Code:
Private Sub Workbook_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A:ZZ")) Is Nothing Then
End If
ActiveWorkbook.Calculate
End Sub