Excel Macro liste déroulante et SendKeys
Résolu
Gaetan95800
Messages postés
10
Statut
Membre
-
Gaetan95800 Messages postés 10 Statut Membre -
Gaetan95800 Messages postés 10 Statut Membre -
Bonjour,
J'aimerais inserer la dedans ;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.Intersect(Target, Range("Saisie")) Is Nothing Then Exit Sub
With Target
If .Rows.Count > 1 Or .Columns.Count > 1 Then Exit Sub
With .Validation
.Modify Formula1:="=ListInitiale"
End With
End With
SendKeys "%{DOWN}", False
End Sub
Ceci ;
'If Application.Intersect(Target, Range("aatest")) Is Nothing Then Exit Sub
'SendKeys "%{DOWN}", False
Il est pas possible de faire 2x Worksheet_selection, malheureusement :)
du genre --> :)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.Intersect(Target, Range("aatest")) Is Nothing Then Exit Sub
SendKeys "%{DOWN}", False
End Sub
Merci :)
J'aimerais inserer la dedans ;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.Intersect(Target, Range("Saisie")) Is Nothing Then Exit Sub
With Target
If .Rows.Count > 1 Or .Columns.Count > 1 Then Exit Sub
With .Validation
.Modify Formula1:="=ListInitiale"
End With
End With
SendKeys "%{DOWN}", False
End Sub
Ceci ;
'If Application.Intersect(Target, Range("aatest")) Is Nothing Then Exit Sub
'SendKeys "%{DOWN}", False
Il est pas possible de faire 2x Worksheet_selection, malheureusement :)
du genre --> :)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.Intersect(Target, Range("aatest")) Is Nothing Then Exit Sub
SendKeys "%{DOWN}", False
End Sub
Merci :)
Configuration: Windows Vista Firefox 3.0.10
1 réponse
-
Bonjour,
Je propose de modifier comme cela pour inclure les deux cas :
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Application.Intersect(Target, Range("Saisie")) Is Nothing Then If Not (Application.Intersect(Target, Range("aatest")) Is Nothing) Then SendKeys "%{DOWN}", False End If Else With Target If .Rows.Count = 1 And .Columns.Count = 1 Then With .Validation .Modify Formula1:="=ListInitiale" End With End If End With SendKeys "%{DOWN}", False End If End Sub
A+