Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

sub dans un range de cellules

2 réponses
Avatar
BeBo
Bonjour j'ai ce code :

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If ActiveCell =3D True Then
Exit Sub
Else
If ActiveCell =3D False Then
MsgBox "Affecter la macro ici"
End If
End If
End Sub "

mais aimerais l'ex=E9cuter que dans une plage de cellule d=E9finie
par ex de A1:B5

qqun pourrait m'aider ?
merci

2 réponses

Avatar
anonymousA
Bonjour

set plage=sh.range("A1:B5")
if not intersect(target,plage) is nothing then
If ActiveCell = True Then
Exit Sub
Else
If ActiveCell = False Then
MsgBox "Affecter la macro ici"
End If
End If
end if

A+
Avatar
ThierryP
bonjour BeBo,

Ajoute cette ligne au début du code :
if intersect(Target,range("A1:B5")) is nothing then exit sub

Bonjour j'ai ce code :

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If ActiveCell = True Then
Exit Sub
Else
If ActiveCell = False Then
MsgBox "Affecter la macro ici"
End If
End If
End Sub "

mais aimerais l'exécuter que dans une plage de cellule définie
par ex de A1:B5

qqun pourrait m'aider ?
merci



--
@+ thierryp