Bonjour,
Cette macro fonctionne bien quand i=nombre
Or quand je mais i=Application.CountA([A32:A41]), il ne se passe rien.
auriez vous une solution?
Merci par avance.
Sub Macro3()
Dim Row As Long, LeRep1 As String, nomfichier
nomfichier = ThisWorkbook.Name
LeRep1 = ThisWorkbook.Path & "\Exploitation des données retouche.xlsx" ' à adapter"
Workbooks.Open Filename:= _
LeRep1
i = Application.CountA([A32:A41])
For c = 1 To i
Windows(nomfichier).Activate
Range("C4").Copy
Windows("Exploitation des données retouche.xlsx").Activate
Row = Range("C" & Rows.Count).End(xlUp).Row + 1
Cells(Row, 3).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = 0
Next c
For d = 1 To i
Windows(nomfichier).Activate
Range("H44").Copy
Windows("Exploitation des données retouche.xlsx").Activate
Row = Range("D" & Rows.Count).End(xlUp).Row + 1
Cells(Row, 4).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = 0
Next d
End Sub