Convertir VBA Excel en Libreoffice

Bonjour, je suis d’un niveau très débutant sur le codage en général. Dans mon travail, j’ai eu besoin de créer ce code sur Excel (pour une synthèse d’enquête de satisfaction), or à mon travail, ils utilisent Libreoffice et je n’ai aucune idée de comment faire pour qu’il fonctionne. La vérité c’est qu’il fonctionne lorsque j’ouvre le document mais dès que je l’enregistre, c’est fini, le programme ne fonctionne plus, je ne comprends pas pourquoi. Si quelqu’un pouvait m’aider et m’expliquer, ce serait incroyable !

Voici le programme (l’objectif est lorsque je double clique sur une cellule, cela fasse +1 et lorsque je clique droit, cela fasse -1, pour la première commande, c’est quon a une note sur nos enquêtes de satisfaction de 1 à 10, donc lorsque je double clique sur 6 par exemple, et bien ça prends la note et ça lui rajoute 6) :

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range(« A19:J19 »)) Is Nothing Then
Application.EnableEvents = False
If Range(« B20 »).Value = ActiveCell + Range(« B20 »).Value Then
Range(« B20 »).ClearContents
Else
Range(« B20 »).Value = ActiveCell.Value + Range(« B20 »).Value
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« K19 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« B1 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A4:H4 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A8:E8 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A11:D11 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A14:D14 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A17:D17 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell + 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value + 1
End If
Cancel = True
End If
Application.EnableEvents = True
End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range(« A19:J19 »)) Is Nothing Then
Application.EnableEvents = False
If Range(« B20 »).Value = Range(« B20 ») - ActiveCell Then
Range(« B20 »).ClearContents
Else
Range(« B20 »).Value = Range(« B20 ») - ActiveCell.Value
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« K19 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« B1 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A4:H4 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A8:E8 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A11:D11 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A14:D14 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
If Not Intersect(Target, Range(« A17:D17 »)) Is Nothing Then
Application.EnableEvents = False
If ActiveCell.Value = ActiveCell - 1 Then
ActiveCell.ClearContents
Else
ActiveCell.Value = ActiveCell.Value - 1
End If
Cancel = True
End If
Application.EnableEvents = True
End Sub

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.