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
| Sub AutoRemplissage()
Dim x, s, d As Integer
Dim Sr, Dr As Range
Dim Ws As Worksheet
For x = 3 To 6
Set Ws = ThisWorkbook.Sheets(x)
Ws.Select
Range("A2500").Select
Selection.End(xlUp).Select
d = ActiveCell.Row
Set Dr = Ws.Range(Cells(d, 1), Cells(d, 2))
Range("C2500").Select
Selection.End(xlUp).Select
s = ActiveCell.Row
Set Sr = Ws.Range(Cells(s, 1), Cells(s, 2))
'ligne en litige
Sr.AutoFill Destination:=Dr
'testé avec
Range(Sr).AutoFill Destination:=Range(Dr)
Next
End Sub |
Partager