Can someone please point me to somewhere I can find out how to re-write Excel VBA so it is compatible with Libre Calc.
My VBA is below: (it sums the values of cells with a particular background colour, not sure I need “range” for the cell_color a sit points to a single reference cell for the colour. Please ignore the color/colour differences, I’m in UK so I include the “u”)!
I have a few other “sum” VBA scripts, but once I solve the below, the rest will follow.
Function SumCellsByColor(data_range As Range, cell_color As Range)
Dim indRefColor As Long
Dim cellCurrent As Range
Dim sumRes
Application.Volatile
sumRes = 0
indRefColor = cell_color.Cells(1, 1).Interior.Color
For Each cellCurrent In data_range
If indRefColor = cellCurrent.Interior.Color Then
sumRes = WorksheetFunction.Sum(cellCurrent, sumRes)
End If
Next cellCurrent
SumCellsByColor = sumRes
End Function