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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
| Sub Date_de_convocation()
Load UserForm2
UserForm2.Show
End Sub
Sub Convoc(DateConv As Date)
'
' Convoc Macro
' Macro enregistrée le 14/11/2011
'initialisation convoc alcoataudon
Sheets("convocs").Activate
Worksheets("convocs").Unprotect Password:="alcoataudon" 'on enlève le mot de passe
Range("B14:N35").Select
Selection.ClearContents
Sheets("choix").Activate
coldate = 7
Do While ((Cells(1, coldate)) <> DateConv)
coldate = coldate + 1
Loop
'UserForm1.Hide
Unload UserForm2
Application.ScreenUpdating = False
'Mise en forme dans la feuille convocs
Sheets("choix").Activate
lgA = 15
lgB = 15
lgC = 15
lgD = 15
lgE = 15
lgU19 = 15
lgAbsent = 15
lgBlessé = 15
lgSuspendu = 15
lgRotation = 15
lgArrêt = 15
lgRepos = 15
lgAutres = 15
lgU11 = 15
I = 2
Do While (Cells(I, 6) <> "")
ref = Cells(I, coldate)
nom = Cells(I, 1)
Sheets("convocs").Activate
Select Case ref
Case "A"
Cells(lgA, 2) = nom
lgA = lgA + 1
Case "B"
Cells(lgB, 3) = nom
lgB = lgB + 1
Case "C"
Cells(lgC, 4) = nom
lgC = lgC + 1
Case "D"
Cells(lgD, 5) = nom
lgD = lgD + 1
Case "E"
Cells(lgE, 6) = nom
lgE = lgE + 1
Case "U19"
Cells(lgU19, 6) = nom
lgU19 = lgU19 + 1
Case "Absent"
Cells(lgAbsent, 7) = nom
lgAbsent = lgAbsent + 1
Case "Blessé"
Cells(lgBlessé, 8) = nom
lgBlessé = lgBlessé + 1
Case "Suspendu"
Cells(lgSuspendu, 9) = nom
lgSuspendu = lgSuspendu + 1
Case "Rotation"
Cells(lgRotation, 10) = nom
lgRotation = lgRotation + 1
Case "Arrêt"
Cells(lgArrêt, 11) = nom
lgArrêt = lgArrêt + 1
Case "Repos"
Cells(lgRepos, 12) = nom
lgRepos = lgRepos + 1
Case "Autres"
Cells(lgAutres, 13) = nom
lgAutres = lgAutres + 1
Case "U11"
Cells(lgU11, 14) = nom
lgU11 = lgU11 + 1
'Case "Libre 1"
'Cells(lgLibre1, 14) = nom
'Cells(lgLibre1, 15) = prenom
'lgLibre1 = lgLibre1 + 1
'Case "Libre 2"
'Cells(lgLibre2, 14) = nom
'Cells(lgLibre2, 15) = prenom
'lgLibre2 = lgLibre2 + 1
'Case "Suspendu"
'Cells(lgSuspendu, 14) = nom
'Cells(lgSuspendu, 15) = prenom
'lgSuspendu = lgSuspendu + 1
'Case "Blessé"
'Cells(lgBlessé, 14) = nom
'Cells(lgBlessé, 15) = prenom
'lgBlessé = lgBlessé + 1
Case Else
End Select
I = I + 1
Sheets("choix").Activate
Loop
Sheets("convocs").Activate
Cells(1, 1) = DateConv
Range("B1").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-27]C[-4]="""","""",VLOOKUP(R[-27]C[-4],membres1!C[-4]:C[6],11))"
Range("F43").Select
ActiveWindow.SmallScroll Down:=9
Range("F42").Select
Selection.AutoFill Destination:=Range("F42:F61"), Type:=xlFillDefault
Range("F42:F61").Select
Range("F62").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-47]C[-3]="""","""",VLOOKUP(R[-47]C[-3],membres1!C[-4]:C[6],11))"
Range("F63").Select
ActiveWindow.SmallScroll Down:=18
Range("F62").Select
Selection.AutoFill Destination:=Range("F62:F81"), Type:=xlFillDefault
Range("F62:F81").Select
Range("F82").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-67]C[-2]="""","""",VLOOKUP(R[-67]C[-2],membres1!C[-4]:C[6],11))"
Range("F83").Select
ActiveWindow.SmallScroll Down:=18
Range("F82").Select
Selection.AutoFill Destination:=Range("F82:F101"), Type:=xlFillDefault
Range("F82:F101").Select
Range("F102").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-87]C[-1]="""","""",VLOOKUP(R[-87]C[-1],membres1!C[-4]:C[6],11))"
Range("F103").Select
ActiveWindow.SmallScroll Down:=18
Range("F102").Select
Selection.AutoFill Destination:=Range("F102:F121"), Type:=xlFillDefault
Range("F102:F121").Select
Range("F122").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-107]C="""","""",VLOOKUP(R[-107]C,membres1!C[-4]:C[6],11))"
Range("F123").Select
ActiveWindow.SmallScroll Down:=15
Range("F122").Select
Selection.AutoFill Destination:=Range("F122:F141"), Type:=xlFillDefault
Range("F122:F141").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-134]C[-4]="""","""",VLOOKUP(R[-134]C[-4],dirigeants!C[-5]:C,6))"
Range("F142").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-136]C[-4]="""","""",VLOOKUP(R[-136]C[-4],dirigeants!C[-5]:C,11))"
Range("F142").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-136]C[-4]="""","""",VLOOKUP(R[-136]C[-4],dirigeants!C[-5]:C,6))"
Range("F144").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-138]C[-3]="""","""",VLOOKUP(R[-138]C[-3],dirigeants!C[-5]:C,6))"
Range("F145").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-136]C[-3]="""","""",VLOOKUP(R[-136]C[-3],dirigeants!C[-5]:C,6))"
Range("F146").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-140]C[-2]="""","""",VLOOKUP(R[-140]C[-2],dirigeants!C[-5]:C,6))"
Range("F147").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-138]C[-2]="""","""",VLOOKUP(R[-138]C[-2],dirigeants!C[-5]:C,6))"
Range("F148").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-142]C[-1]="""","""",VLOOKUP(R[-142]C[-1],dirigeants!C[-5]:C,6))"
Range("F149").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-140]C[-1]="""","""",VLOOKUP(R[-140]C[-1],dirigeants!C[-5]:C,6))"
Range("F150").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-144]C="""","""",VLOOKUP(R[-144]C,dirigeants!C[-5]:C,6))"
Range("F151").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-142]C="""","""",VLOOKUP(R[-142]C,dirigeants!C[-5]:C,6))"
Range("F152").Select
Dim Cel As Range
Dim Adresses_Mail As Object
Set Adresses_Mail = CreateObject("Scripting.Dictionary")
For Each Cel In Range("f42:f156" & [f65000].End(xlUp).Row)
Adresses_Mail(Cel.Value) = Cel.Value
Next Cel
Range("b41").Value = Join(Adresses_Mail.Items, ";")
Worksheets("convocs").Protect Password:="alcoataudon" 'on enlève le mot de passe
Application.ScreenUpdating = True
End Sub |
Partager