Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSub essai() Sheets("Feuil1").Activate Range(Range("a" & Rows.Count).End(xlUp).Rows, Range("E" & Rows.Count).End(xlUp).Rows).Select Selection.Copy Sheets("Feuil2").Activate Range("A2").Activate ActiveSheet.Paste End Sub
J'attendrai alors également que tu clarifies ton exposé, qui ne permet absolument pas pour l'instant de comprendre en vertu de quoi tu sélectionnes ce que tu as mis en rouge
La première, pour récupérer la dernière combinaison ...
Sub essai2() Sheets("Feuil1").Activate For Counter = 1 To Range("A" & Rows.Count).End(xlUp).Row Set curcell = Worksheets("feuil1").Cells(Counter, 1) If Abs(curcell.Value) = Range("A1").End(xlDown) Then curcell.EntireRow.Copy Sheets("Feuil2").Activate Range("A1048576").End(xlUp).Offset(1, 0).Activate ActiveSheet.Paste Next Counter End Sub
Sub essai2() Dim DerLigne As Long DerLigne = Range("A" & Rows.Count).End(xlUp).Row For Counter = 1 To DerLigne Set curcell = Worksheets("feuil1").Cells(Counter, 1) If Abs(curcell.Value) = Range("A1").End(xlDown) Then curcell.EntireRow.Copy ActiveSheet.Paste Destination:=Sheets("feuil2").Range("A1048576").End(xlUp).Offset(1, 0) Next Counter End Sub
With Sheets("Feuil1") derlig = .Range("A" & Rows.Count).End(xlUp).Row maval = .Range("A" & derlig).Value For counter = 1 To derlig If .Range("A" & counter) = maval Then .Rows(counter).Copy Destination:=Sheets("Feuil2").Range("A" & Sheets("Feuil2").Range("A" & Rows.Count).End(xlUp).Row + 1) End If Next counter End With