Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Value > 0 Then If ActiveCell.Value <= 10 Then MsgBox "selection 0-10" End If End If If ActiveCell.Value > 10 Then If ActiveCell.Value <= 20 Then MsgBox "selection 10-20" End If End If If ActiveCell.Value > 20 Then If ActiveCell.Value <= 30 Then MsgBox "selection 20-30" End If End If If ActiveCell.Value > 30 Then If ActiveCell.Value <= 40 Then MsgBox "selection 30-40" End If End If End Sub
Select Case ActiveCell.Value case 1 to 10 MsgBox "1-10" Case 11 to 20 MsgBox "11-20" Case 21 to 30 MsgBox "21-30" Case Else MsgBox "Autre" end select If ActiveCell.value <=0 then MsgBox "<=0" elseif ActiveCell.value<=10 Then MsgBox "1-10" elseif ActiveCell.value<=20 Then MsgBox "11-20" elseif ActiveCell.value<=30 Then MsgBox "21-30" else MegBox ">20" end if if ActiveCell.value>=1 And ActiveCell.value<=10 Then MsgBox "1-10" elseif ActiveCell.value>=11 And ActiveCell.value<=20 Then MsgBox "11-20" elseif ActiveCell.value>=21 And ActiveCell.value<=30 Then MsgBox "21-30" else MegBox "Autre" end if