bonjour,

J'ai un problème avec mon code. J'ai deux feuilles ouvertes. Une sert de base et l'autre réceptionne les données.
J'ai un problème avec mon workbook qui sert de base. j'ai syntax error. j'ai lu le tutoriel mais je ne parviens pas à repérer mon erreur.

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
Sub Reporter()
Dim Sh As Worksheet
Dim activitiesdata As Workbook
Dim LastLig As Long, NewLig As Long
Dim c As Range
Dim Valeur As String
 
(activitiesdata) = workbooks("2010 STD Activities status")
 
 
Valeur = InputBox("Entrée période", "Choix de la période")
If Valeur <> "" Then
Application.ScreenUpdating = False
With activitiesdata.Worksheets("2010")
   .AutoFilterMode = False
   LastLig = .Cells(.Rows.Count, "A").End(xlUp).Row
   With .Range("A4:X" & LastLig)
      .AutoFilter field:=17, Criteria1:=Valeur
      .AutoFilter field:=24, Criteria1:=">0"
   End With
   If .Range("A4:A" & LastLig).SpecialCells(xlCellTypeVisible).Count > 1 Then
      Set Sh = Worksheets("datas test")
      NewLig = Sh.Cells(Sh.Rows.Count, "A").End(xlUp).Row + 1
      For Each c In .Range("A5:A" & LastLig).SpecialCells(xlCellTypeVisible)
         Sh.Cells(NewLig, 1).Value = .Cells(c.Row, 7).Value
         Sh.Cells(NewLig, 2).Value = .Cells(c.Row, 8).Value
         Sh.Cells(NewLig, 5).Value = .Cells(c.Row, 10).Value
         Sh.Cells(NewLig, 7).Value = .Cells(c.Row, 12).Value
         Sh.Cells(NewLig, 15).Value = .Cells(c.Row, 17).Value
         Sh.Cells(NewLig, 11).Value = .Cells(c.Row, 24).Value
         NewLig = NewLig + 1
      Next c
      Set Sh = Nothing
      .AutoFilterMode = False
   End If
End With
End If
End Sub
Merci d'avance