Msgbox

GANDALF001

XLDnaute Nouveau
Bonjour,

Pourriez-vous aider un débutant.

Je voudrais qu'un Msgbox s'affiche si le résultat d'une formule dépasse 44.

Merci de votre aide [file name=helpmsgbox.zip size=4532]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/helpmsgbox.zip[/file]

Message édité par: GANDALF001, à: 02/11/2005 22:51
 

Pièces jointes

  • helpmsgbox.zip
    4.4 KB · Affichages: 16

excalibur

XLDnaute Impliqué
bonjour GANDALF001 , le forum au niveau de ta feuil1 evenement Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range('a6').Value > 44 Then MsgBox ' attention valeur > 44 '
End Sub' salutations [file name=helpmsgbox_20051102225819.zip size=6398]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/helpmsgbox_20051102225819.zip[/file]
 

Pièces jointes

  • helpmsgbox_20051102225819.zip
    6.2 KB · Affichages: 10

myDearFriend!

XLDnaute Barbatruc
Bonsoir GANDALF001, Gérard, excalibur,

Pour ma part, je proposerais :
Private Sub Worksheet_Change(ByVal Target As Range)
      If Not Application.Intersect(Target, Range('A1:A5')) Is Nothing Then
            If Range('A6').Value > 44 Then MsgBox ' la fomule en ''A6'' dépasse 44'
      End If
End Sub
On aurait pu également essayer :
Private Sub Worksheet_Calculate()
      If Sheets('Feuil1').Range('A6').Value > 44 Then MsgBox ' la fomule en ''A6'' dépasse 44'
End Sub
Mais cette solution, tout comme la solution passant par l'évènement SelectionChange(), comporte le risque de ralentir quelque peu l'application...

Cordialement,

[file name=mDF_helpmsgbox.zip size=5796]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/mDF_helpmsgbox.zip[/file]
 

Pièces jointes

  • mDF_helpmsgbox.zip
    5.7 KB · Affichages: 14

Statistiques des forums

Discussions
312 668
Messages
2 090 739
Membres
104 643
dernier inscrit
adriano22