F
franck
Guest
Code:
Private Sub ComboBox1_Change()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim l As Integer
Dim nom
nom = ComboBox1.Value
Worksheets(nom).Activate
With Worksheets(nom)
.Unprotect
.Range('B3:AC33') = ClearContents
.Range('A2').Select
End With
k = 33
Worksheets('juin').Activate
With Worksheets('juin')
For i = .Range('e1000').End(xlUp).Row To 1 Step -1
If .Cells(i, 5) <> '' Then
For j = .Range('f1000').End(xlUp).Row To 1 Step -1
If UCase(.Cells(j, 6)) = UCase(nom) Then
Worksheets(nom).Range('b' & k) = .Range(Cells(j, 7), Cells(j, 34))
If k = 3 Then
Exit Sub
Else
k = k - 1
End If
End If
Next
End If
Next
.Protect
End With
End Sub
ce code plante lors de la copy
erreur definie par l'application ou par l'objet
ce code est ecris sur une feuilles et non dans un module
je n'arrive pas à la faire fonctionner dans un module
par contre ce code fonctionne avec un bouton et en entrant le nom voulu
par avance merci à tous