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 35 36 37 38 39 40 41 42 43
| Sub Macro1()
'
' Macro1 Macro
'
'
Application.Dialogs.Item(xlDialogOpen).Show
Range("A1:AH" & Range("A65536").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
Selection.Copy
ActiveWindow.Close
Windows("Cotisations macro.xlsm").Activate
Range("A1").Select
ActiveSheet.Paste
Range("AI1").Select
ActiveCell.FormulaR1C1 = "Doublons"
Range("AI2").Select
ActiveCell.FormulaR1C1 = _
"=IF(COUNTIF(R2C15:RC[-20],RC[-20])=1,SUMIF(C[-20],RC[-20],C[-4]),"""")"
Dim LastRw As Long
LastRw = Sheets("Feuil1").Cells(Rows.Count, 1).End(xlUp).Row
Range("AI2:AI" & LastRw).FillDown
Columns("AI:AI").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AJ1").Select
ActiveCell.FormulaR1C1 = "Analyse doublons"
Range("AJ2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=1,""pas de doublon"",""doublon"")"
Range("AJ2").Select
LastRw = Sheets("Feuil1").Cells(Rows.Count, 1).End(xlUp).Row
Range("AJ2:AJ" & LastRw).FillDown
End Sub |
Partager