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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| Sub Macro1()
Dim Plage As Range, C As Range
Dim LastLig As Long, i As Long
Application.ScreenUpdating = False
With ActiveSheet
.Name = "R"
.Cells.HorizontalAlignment = xlCenter
'Mise en forme des colonnes
.Rows("1:1").RowHeight = 48
.Columns("A:A").ColumnWidth = 5.86
.Columns("E:E").ColumnWidth = 25.86
.Columns("F:F").ColumnWidth = 19.14
.Columns("G:G").ColumnWidth = 11.29
.Columns("H:H").ColumnWidth = 11.57
.Columns("K:K").ColumnWidth = 5.29
.Columns("S:S").ColumnWidth = 33.57
'Mise sous forme de tableau
With .ListObjects.Add(xlSrcRange, .Cells(1, 2).CurrentRegion, xlYes)
.Name = "Tableau1"
.TableStyle = "TableStyleMedium6"
'.Sort.SortFields.Clear
'.Sort.SortFields.Add Key:=Range("Tableau1[[#All],[Age]]"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlNormal
End With
'Niveau de rémunération
LastLig = .Cells(.Rows.Count, 5).End(xlUp).Row
For i = LastLig To 2 Step -1
If .Cells(i, 5).Text Like "" Then _
.Cells(i, 5).Interior.ColorIndex = 3
Next i
'Présence de prix
LastLig = .Cells(.Rows.Count, 7).End(xlUp).Row
For i = LastLig To 2 Step -1
If .Cells(i, 7).Text = "NON" Then _
.Cells(i, 7).Interior.ColorIndex = 3
Next i
'Disponibilité
LastLig = .Cells(.Rows.Count, 8).End(xlUp).Row
For i = LastLig To 2 Step -1
If .Cells(i, 8).Text Like "*pas dispo*" Then _
.Cells(i, 8).Interior.ColorIndex = 3
Next i
'Prospection
Set Plage = .Range(.Cells(2, 10), .Cells(.Rows.Count, 10).End(xlUp))
For Each C In Plage
If C.Value = "ETAB" Then
If ((C.Offset(0, 1).Value Like "*A jour*") Or (C.Offset(0, 1).Value Like "*A voir *") Or (C.Offset(0, 1).Value Like "*Relance*")) Then
C.Offset(0, 1).Interior.Color = vbRed
End If
End If
Next C
'Âge apprenti inférieur à 26 ans
Set Plage = .Range(.Cells(2, 18), .Cells(.Rows.Count, 18).End(xlUp))
For Each C In Plage
If C.Value < 26 Then _
C.Interior.Color = vbCyan
Next C
'Plan dactions vide
Set Plage = .Range(.Cells(2, 19), .Cells(.Rows.Count, 19).End(xlUp))
For Each C In Plage
If C.Value = "" Then _
C.Interior.Color = vbCyan
Next C
End With
Application.ScreenUpdating = True
End Sub |
Partager