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 :)
A voir également:
- Excel Macro liste déroulante et SendKeys
- Liste déroulante excel - Guide
- Excel liste déroulante en cascade - Guide
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Word et excel gratuit - Guide
- Si et ou excel - Guide
1 réponse
Bonjour,
Je propose de modifier comme cela pour inclure les deux cas :
A+
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+
Si par hasard je veux inclure un cas identique au 1er ? (par curiosité :))
Merci