Bonjour,
J'ai besoin d'aide concernant mon programme de RechercheV ci-contre :
A l'exécution il m'affiche que la méthode Autofill a échoué. Alors que j'ai tout fait.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 Dim Ligne As Integer Dim ListeEtudiant As String Dim rng As Range Private Sub Worksheet_Change(ByVal Target As Range) Ligne = ActiveCell.Row For Each cellule In Selection If Not Intersect([H12:H26], Target) Is Nothing And Target.Count = 1 Then If Not Target.Address <= "$G$11" Then Set TableauRecherche = Sheets("Feuil2").UsedRange With Sheets("Feuil1") .Cells(Ligne, 7).Formula = "=VLOOKUP(" & Columns(8).Address & ",Feuil2!" & TableauRecherche.Address & ",3,FALSE)" ' Probléme Set rng = Worksheets("Feuil2").Range("G11:G26") Selection.AutoFill Destination:=rng, Type:=xlFillDefault End With End If End If Next cellule End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Selection.Cells.CountLarge > 10 Then Else Ligne = ActiveCell.Row ' Gestion de validation des données de liste déroulante If Not Intersect(Target, Range("H12:H26")) Is Nothing Then If Not Target.Address <= "$H$11" Then ListeEtudiant = "='Feuil2'!$A$2:$A$9" With Range("H" & Ligne).Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=ListeEtudiant End With End If End If End If End Sub
En PJ le fichier xls si besoin.
Je crois que je vais jeter mon PC par la fenêtre
Merci d'avance de me sortir de ce pétrin.![]()
Partager