salve
le macro inserite nel foglio sono per Excel mi era sfuggito che la richiesta era per Open Office.
VBA Office e VBa Openoffice usano sintassi diverse.
sostituisci le due macro con quelle qui sotto:
Function SommaColoreUscite(colore As Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1), RDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1) As Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1))
Dim Cl As Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)
Dim Col As Integer
Dim Ttot As Long
Col = colore.Interior.ColorIndex
For N = 2 To RDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1).Columns.Count + 1 Step 3
If Cells(RDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1).Row, N).Interior.ColorIndex = Col Then
Ttot = Ttot + Cells(RThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet.getCellDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)ByName(.Row, N)).Value
End If
Next N
SommaColoreUscite = Ttot
End Function
Function SommaColoreEntrate(colore As Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1), RDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1) As Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1))
Dim Cl As Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)
Dim Col As Integer
Dim Ttot As Long
Col = colore.Interior.ColorIndex
For N = 3 To RDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1).Columns.Count + 1 Step 3
If Cells(RDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1).Row, N).Interior.ColorIndex = Col Then
Ttot = Ttot + Cells(RThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet.getCellDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)ByName(.Row, N)).Value
End If
Next N
SommaColoreEntrate = Ttot
End Function
NB. Ho usato un convertitore in rete e non avendo OO non posso provarle
saluti
Giap