Worksheet_SelectionChange(ByVal Target As Range)

STEPHANE786

XLDnaute Nouveau
bonjour
je n arrive pas a faire fonctionnner la macro il faudrait compiler les deux je pense mais trop difficile pour moi

merci pour votre aide


Private Sub Worksheet_Change(ByVal Target As Range)
Dim Isect As Range
Static IsOn As Boolean
If IsOn Then
IsOn = False
Exit Sub
End If
Set Isect = Application.Intersect(Target, Range("Saisie"))
If Isect Is Nothing Then Exit Sub


With Target
If .Rows.Count > 1 Or .Columns.Count > 1 Then Exit Sub
If .Value = "" Then Exit Sub
Sheets("liste deroulante").Range("A300").Value = .Value
With .Validation
.Modify Formula1:="=Listename"
End With
End With
SendKeys "%{DOWN}", False
IsOn = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Isect As Range
Set Isect = Application.Intersect(Target, Range("Saisie"))

If Isect Is Nothing Then Exit Sub

With Target
If .Rows.Count > 1 Or .Columns.Count > 1 Then Exit Sub
With .Validation
.Modify Formula1:="=ListeAlpha"
End With
End With
SendKeys "%{DOWN}", False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If m <> "" Then Range(m).Comment.Visible = False
If Not Target.Comment Is Nothing Then
Target.Comment.Visible = True
Target.Comment.Shape.Left = Target.Left - Target.Comment.Shape.Width - 10
m = Target.Address
Else
m = ""
End If
End Sub
 

STEPHANE786

XLDnaute Nouveau
Re : Worksheet_SelectionChange(ByVal Target As Range)

Par défaut Worksheet_SelectionChange(ByVal Target As Range)
bonjour a tous
merci JCGL
la solution double clic sur la cellule ou il y a commentaire et en plus je peux choisir la position du commentaire
mais cela efface le triangle rouge>>>>solution changer le format de la cellule pour indiquer commentaire
ou en vba si vous avez une solution
merci pour votre aide


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)


Dim C As Comment
On Error Resume Next
Set C = Target.Comment
If Not C Is Nothing Then
Application.DisplayCommentIndicator = xlyesIndicator
C.Visible = True
Else
Application.DisplayCommentIndicator = xlyesIndicator
Err.Clear
End If



End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
Dim Isect As Range
Static IsOn As Boolean
If IsOn Then
IsOn = False
Exit Sub
End If
Set Isect = Application.Intersect(Target, Range("Saisie"))
If Isect Is Nothing Then Exit Sub


With Target
If .Rows.Count > 1 Or .Columns.Count > 1 Then Exit Sub
If .Value = "" Then Exit Sub
Sheets("liste deroulante").Range("A300").Value = .Value
With .Validation
.Modify Formula1:="=Listename"
End With
End With
SendKeys "%{DOWN}", False
IsOn = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Isect As Range
Set Isect = Application.Intersect(Target, Range("Saisie"))

If Isect Is Nothing Then Exit Sub

With Target
If .Rows.Count > 1 Or .Columns.Count > 1 Then Exit Sub
With .Validation
.Modify Formula1:="=ListeAlpha"
End With
End With
SendKeys "%{DOWN}", False
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 321
Messages
2 087 259
Membres
103 498
dernier inscrit
FAHDE