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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
| Dim f
Private Sub b_exit_usf6_Click()
Unload UserForm1 'masque aussi userform1
End Sub
Private Sub UserForm_Initialize()
Set f = Sheets("BD")
Set mondico = CreateObject("Scripting.Dictionary") 'Création du dictionaire
For Each C In Range(f.[A2], f.[A65000].End(xlUp))
mondico(C.Value) = C.Value
Next C
Me.ListBox1.List = mondico.items
Me.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub
Private Sub ListBox1_Change()
Me.ListBox3.Clear
Set mondico = CreateObject("Scripting.Dictionary") 'Après avoir sélectionner dans la Liste des Rubriques
For Each C In Range(f.[A2], f.[D65000].End(xlUp)) 'On génère un second dictionaire pour la liste des phases
For k = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(k) = True Then
If C = Me.ListBox1.List(k, 0) Then
temp = C.Offset(, 2)
mondico(temp) = temp
End If
End If
Next k
Next C
Me.ListBox2.List = mondico.items
End Sub
Private Sub ListBox2_Change()
Me.ListBox3.Clear
For Each C In Range(f.[C2], f.[C65000].End(xlUp)) 'Après avoir sélectionner dans la list des phases
For k = 0 To Me.ListBox2.ListCount - 1 'On affiche la liste des taches
If Me.ListBox2.Selected(k) = True Then
If C = Me.ListBox2.List(k, 0) Then Me.ListBox3.AddItem C.Offset(, 1)
End If
Next k
Next C
End Sub
Private Sub CommandButton1_Click()
Dim I As Integer, y As Integer
'Dim Cel As Range
'Set Cel = Sh.[B:B].Find("*", , , , xlByRows, xlPrevious)
'If Cel Is Nothing Then Exit Sub
'y = Cel.Row
Set sh = Sheets("Feuil1")
y = sh.[B:B].Find("*", , , , xlByRows, xlPrevious).Row
With Me.ListBox1
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
sh.Range("B" & y).Value = .List(I)
' With sh.Range("A" & y & ":G" & y).Interior
' .Pattern = xlSolid
' .ThemeColor = xlThemeColorAccent6
' .TintAndShade = 0.799981688894314
' .Color = 10066431
' End With
With sh.Range("B" & y).Font
.Name = "Calibri"
.Size = 9
.Bold = True
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0
End With
End If
Next I
With Me.ListBox2
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
sh.Range("B" & y).Value = .List(I)
With sh.Range("B" & y).Font
.Name = "Calibri"
.Size = 9
.Bold = True
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0
End With
End If
Next I
End With
With Me.ListBox3
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
sh.Range("B" & y).Value = .List(I)
With sh.Range("B" & y).Font
.Name = "Calibri"
.FontStyle = "Normal"
.Size = 9
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
End If
Next I
End With
'Range("G12").Formula = "=VLOOKUP(B12,tableau3,2,0)"
Range("G12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau3,2,False)),"""",VLOOKUP(B12,tableau3,2,False))"
Range("C12:G12").HorizontalAlignment = xlCenter
Range("C12:G12").VerticalAlignment = xlCenter
Range("G12").AutoFill Range("G12:G" & Range("B65536").End(xlUp).Row)
Range("F12").Formula = "=IF(ISERROR(SUM(RC[-2]*RC[-1])),"""",SUM(RC[-2]*RC[-1]))"
Range("F12").AutoFill Range("F12:F" & Range("B65536").End(xlUp).Row)
Range("D12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau7,4,False)),"""",VLOOKUP(B12,tableau7,4,False))"
Range("D12").AutoFill Range("D12:D" & Range("B65536").End(xlUp).Row)
Range("C12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau7,3,False)),"""",VLOOKUP(B12,tableau7,3,False))"
Range("C12").AutoFill Range("C12:C" & Range("B65536").End(xlUp).Row)
With Application
.ScreenUpdating = False
.DisplayStatusBar = False
.Calculation = xlCalculationManual
End With
With Application
.Calculation = xlCalculationAutomatic
.DisplayStatusBar = True
.CutCopyMode = False
.ScreenUpdating = True
End With
For I = 0 To Me.ListBox1.ListCount - 1
Me.ListBox1.Selected(I) = False
Next I
For I = 0 To Me.ListBox2.ListCount - 1
Me.ListBox2.RemoveItem 0
Next I
For I = 0 To Me.ListBox3.ListCount - 1
Me.ListBox3.RemoveItem 0
Next I
Me.ListBox1.SetFocus
End With
Range("E12:G300").Select
With Selection.Font
.Name = "Calibri"
.Size = 9
' .Strikethrough = False
' .Superscript = False
' .Subscript = False
' .OutlineFont = False
' .Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Selection.Font.Bold = True
Range("D12:D42").Select
With Selection.Font
.Name = "Calibri"
.Size = 9
' .Strikethrough = False
' .Superscript = False
' .Subscript = False
' .OutlineFont = False
' .Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Range("C12:C43").Select
With Selection.Font
With Selection.Font
.Name = "Calibri"
.Size = 9
' .Strikethrough = False
' .Superscript = False
' .Subscript = False
' .OutlineFont = False
' .Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
With Selection.Font
.ThemeColor = xlThemeColorAccent2
.TintAndShade = -0.249977111117893
End With
End With
Range("A1").Select
End Sub
Private Sub CommandButton2_Click()
Dim I As Integer, y As Integer
Set sh = Sheets("Feuil1")
y = sh.[B:B].Find("*", , , , xlByRows, xlPrevious).Row
With Me.ListBox2
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y
End If
Next I
End With
With Me.ListBox3
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
sh.Range("B" & y).Value = .List(I)
With sh.Range("B" & y).Font
.Name = "Calibri"
.FontStyle = "Normal"
.Size = 9
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
End If
Next I
End With
'Range("G12").Formula = "=VLOOKUP(B12,tableau3,2,0)"
Range("G12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau3,2,False)),"""",VLOOKUP(B12,tableau3,2,False))"
Range("C12:G12").HorizontalAlignment = xlCenter
Range("C12:G12").VerticalAlignment = xlCenter
Range("G12").AutoFill Range("G12:G" & Range("B65536").End(xlUp).Row)
Range("F12").Formula = "=IF(ISERROR(SUM(RC[-2]*RC[-1])),"""",SUM(RC[-2]*RC[-1]))"
Range("F12").AutoFill Range("F12:F" & Range("B65536").End(xlUp).Row)
Range("D12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau7,4,False)),"""",VLOOKUP(B12,tableau7,4,False))"
Range("D12").AutoFill Range("D12:D" & Range("B65536").End(xlUp).Row)
Range("C12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau7,3,False)),"""",VLOOKUP(B12,tableau7,3,False))"
Range("C12").AutoFill Range("C12:C" & Range("B65536").End(xlUp).Row)
End Sub
Private Sub CommandButton6_Click()
Dim I As Integer, y As Integer
Set sh = Sheets("Feuil1")
y = sh.[B:B].Find("*", , , , xlByRows, xlPrevious).Row
With Me.ListBox2
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
sh.Range("B" & y).Value = .List(I)
With sh.Range("B" & y).Font
.Name = "Calibri"
.Size = 9
.Bold = True
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0
End With
End If
Next I
End With
With Me.ListBox3
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
sh.Range("B" & y).Value = .List(I)
With sh.Range("B" & y).Font
.Name = "Calibri"
.FontStyle = "Normal"
.Size = 9
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
End If
Next I
End With
'Range("G12").Formula = "=VLOOKUP(B12,tableau3,2,0)"
Range("G12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau3,2,False)),"""",VLOOKUP(B12,tableau3,2,False))"
Range("C12:G12").HorizontalAlignment = xlCenter
Range("C12:G12").VerticalAlignment = xlCenter
Range("G12").AutoFill Range("G12:G" & Range("B65536").End(xlUp).Row)
Range("F12").Formula = "=IF(ISERROR(SUM(RC[-2]*RC[-1])),"""",SUM(RC[-2]*RC[-1]))"
Range("F12").AutoFill Range("F12:F" & Range("B65536").End(xlUp).Row)
Range("D12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau7,4,False)),"""",VLOOKUP(B12,tableau7,4,False))"
Range("D12").AutoFill Range("D12:D" & Range("B65536").End(xlUp).Row)
Range("C12").Formula = "=IF(ISERROR(VLOOKUP(B12,tableau7,3,False)),"""",VLOOKUP(B12,tableau7,3,False))"
Range("C12").AutoFill Range("C12:C" & Range("B65536").End(xlUp).Row)
End Sub |
Partager