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 maj()
Dim plage As Range, clz As Range
Dim derlige As Long
Sheets("clos").Range("a2:c3000").Clear
Sheets("clos").Range("e2:e3000").Clear
Sheets("FICHIER GAL").Select
derlige = Range("A65536").End(xlUp).Row
Set plage = Range("A2:A" & derlige)
Range("f2").Select
Application.ScreenUpdating = False
For Each clz In plage
If ActiveCell.Interior.Color = RGB(127, 127, 127) Then
If ActiveCell.Offset(0, 2).MergeCells Then
ActiveCell.Offset(0, -4).Copy
Sheets("clos").Cells(65535, 5).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(0, -4).Copy
Sheets("clos").Cells(65535, 1).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(0, 1).Copy
Sheets("clos").Cells(65535, 2).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
ActiveCell.Copy
Sheets("clos").Cells(65535, 3).End(xlUp)(2).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End If
End If
ActiveCell.Offset(1, 0).Select
Next clz
Calculate
Application.ScreenUpdating = True
End Sub |
Partager