Re : Problème Macro
Merci Jean Marcel,
Je n'arrive pas à utiliser l'adaptation de ton code, en fait ma macro est plus complète et je crois qu'entre tous les if ça ne marche pas. Je te communiques mon code complet. Merci pour ton aide précieuse.
Pol.
Private Sub MonExcel_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
' Entre 2 plages de cellules
If Target.Areas.Count = 2 Then
Application.StatusBar = "Différence : " & Format(WorksheetFunction.Sum(Target.Areas(1)) - WorksheetFunction.Sum(Target.Areas(2)), "# ##0.00") _
& " Rapport % : " & Format(WorksheetFunction.Sum(Target.Areas(1)) / WorksheetFunction.Sum(Target.Areas(2)) * 100, "# ##0.00")
ElseIf Target.Areas.Count = 1 And WorksheetFunction.Sum(Target) <> 0 Then
Application.StatusBar = "HT : " & Format(Round(WorksheetFunction.Sum(Target) / 1.196, 2), "# ##0.00") _
& " TTC : " & Format(Round(WorksheetFunction.Sum(Target) * 1.196, 2), "# ##0.00") _
& " TVA : " & Format(Round(WorksheetFunction.Sum(Target) * 0.196, 2), "# ##0.00")
Else
Application.StatusBar = ""
End If
End Sub