Salut Myasana,
Salut les as,
après avoir perdu un temps fou à essayer de maîtriser ces f... formules matricielles avec VBA, je suis revenu à une solution bien plus simple (pour moi) afin d'obtenir le résultat souhaité : une simple macro basée sur l'événement 'Change()' et une colonne [L:L] débarrassée de ses formules.
Un changement de date (enfin, il faudrait affiner ça dans tes formules qui n'attendent pas toujours une date mais quelque chose <>"" !!) dans les 3 colonnes concernées par le statut en [K:K] démarre la macro.
Private Sub Worksheet_Change(ByVal Target As Range)
'
Dim tTabS As Object, rCelST, rCelAV, iRow%
'
Application.EnableEvents = False
Application.ScreenUpdating = False
'
Set tTabS = ListObjects("Tableau_PA")
iRow = Target.Row - (tTabS.DataBodyRange.Cells(1, 1).Row - 1)
Set rCelST = tTabS.DataBodyRange.Cells(iRow, 10)
Set rCelAV = tTabS.DataBodyRange.Cells(iRow, 11)
'
If Not Intersect(Target, Union(tTabS.DataBodyRange.Cells(iRow, 4), tTabS.DataBodyRange.Cells(iRow, 6), tTabS.DataBodyRange.Cells(iRow, 7))) Is Nothing Then
rCelAV.Validation.Delete
If rCelST = "En cours" Then
rCelAV.Value = "Choisir %"
rCelAV.Validation.Add Type:=xlValidateList, Formula1:="25%,50%,75%"
Else
rCelAV.Value = IIf(rCelST.Value = "Terminé", "100%", "0%")
End If
End If
'
Application.ScreenUpdating = True
Application.EnableEvents = True
'
End Sub
Merci à Arturo! C'est ta macro qui a été le point de départ de ma "réflexion" !
A+