Bonjour,
voici un tout début de solution (merci excel labo et en particulier au fichier de Jacques Boisgontier sur les macros evènementielles) qui fonctionne pour afficher le résultat dans la même cellule que celle où tu choisi le pourcentage.
il faut coller ce code dans la feuille1 du projet vba de ton fichier en exemple.
restrictions actuelles : tu peux ne faire l'opération qu'une fois (plus de liste déroulante accessible par la suite, je ne sais pas recréer une telle liste, si tu m'indique comment faire, il est probable que je puisse rectifier ce point)
Il y aura un bug (la macro va reboucler) si le résultat du calcul est égal à une des valeurs de la liste déroulante (0; 0.25; 0.5; 0.75; 1)
a+
le code :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = 0 Then
ligne = Target.Row - 7
Range("c7").Offset(ligne, 0).Select
Application.CutCopyMode = False
Selection.Copy
Target.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End If
If Target.Value = 0.25 Then
ligne = Target.Row - 7
Range("c7").Offset(ligne, 0).Select
Application.CutCopyMode = False
Selection.Copy
Target.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End If
If Target.Value = 0.5 Then
ligne = Target.Row - 7
Range("c7").Offset(ligne, 0).Select
Application.CutCopyMode = False
Selection.Copy
Target.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End If
If Target.Value = 0.75 Then
ligne = Target.Row - 7
Range("c7").Offset(ligne, 0).Select
Application.CutCopyMode = False
Selection.Copy
Target.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End If
If Target.Value = 1 Then
ligne = Target.Row - 7
Range("c7").Offset(ligne, 0).Select
Application.CutCopyMode = False
Selection.Copy
Target.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End If
End Sub