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
|
Sub Copier_Valeurs()
Dim WsS As Worksheet, WsC As Worksheet
Dim Cel As Range, C As Range
Dim LigneAjout As Long
Application.ScreenUpdating = False
Set WsS = Worksheets("lala")
Set WsC = Worksheets("toto")
For Each Cel In WsS.Range("L12:L" & WsS.Range("L" & Rows.Count).End(xlUp).Row)
Set C = WsC.Columns(138).Find(Cel, , xlValues, xlWhole)
LigneAjout = WsC.Range("L" & Rows.Count).End(xlUp).Row + 1
If C Is Nothing Then
Cel.Resize(, 9).Copy
WsC.Range("L" & C.Row).PasteSpecial (xlPasteValues)
Else
Cel.Resize(, 16).Copy
WsC.Range("A" & LigneAjout).PasteSpecial (xlPasteValues)
LigneAjout = LigneAjout + 1
End If
Next Cel
Application.CutCopyMode = False
Set C = Nothing: Set WsS = Nothing: Set WsC = Nothing
End Sub |
Partager