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
| Private Sub ListBox1_Click()
Select Case ListBox1.List(ListBox1.ListIndex, 1)
Case 1 To 10: MsgBox ListBox1.List(ListBox1.ListIndex, 0)
Case 11 To 20: MsgBox ListBox1.List(ListBox1.ListIndex, 0)
Case Else: MsgBox ListBox1.List(ListBox1.ListIndex, 0)
End Select
End Sub
Private Sub UserForm_Initialize()
Dim TXT As String, i As Integer
Me.ListBox1.Clear
ListBox1.ColumnCount = 3
With Sheets("Retards")
For i = 0 To .Range("A" & Rows.Count).End(xlUp).Row - 1
If Val(Trim("" & .Range("A2").Offset(i))) <> 0 Then
Me.ListBox1.AddItem i + 2
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = .Range("A2").Offset(i).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = .Range("A2").Offset(i, 1).Value
End If
Next
End With
'Call RetardsControles Appel à une macro qui me importe des lignes de plusieurs tableaux dans un seul selon certains critères
End Sub
'If LineRetard <> 0 Then
'
' For i = 2 To LineRetard
' Set Obj = Me.Controls.Add("forms.label.1")
' With Obj
' .Name = "Ligne" & i
' .Object.Caption = i
' .Left = 1
' .Top = 25 * i
' .Width = 20
' .Height = 20
' .Visible = False
' End With
' Next i
'
' For i = 2 To LineRetard
' Set Obj = Me.Controls.Add("forms.label.1")
' With Obj
' .Name = "lblTypeEPI" & i
' .Object.Caption = Sheets("Retards").Range("A" & i).Value
' .Left = 20
' .Top = 25 * i
' .Width = 90
' .Height = 20
' End With
' Next i
'
' For i = 2 To LineRetard
' Set Obj = Me.Controls.Add("forms.label.1")
' With Obj
' .Name = "lblNEPI" & i
' .Object.Caption = Sheets("Retards").Range("B" & i).Value
' .Left = Me.Controls("lblTypeEPI" & i).Left + Me.Controls("lblTypeEPI" & i).Width - 1
' .Top = 25 * i
' .Width = 110
' .Height = 20
' End With
' Next i
'
' For i = 2 To LineRetard
' Set Obj = Me.Controls.Add("forms.label.1")
' With Obj
' .Name = "lblNom" & i
' .Object.Caption = Sheets("Retards").Range("D" & i).Value
' .Left = Me.Controls("lblNEPI" & i).Left + Me.Controls("lblNEPI" & i).Width - 1
' .Top = 25 * i
' .Width = 150
' .Height = 20
' End With
' Next i
'
' For i = 2 To LineRetard
' Set Obj = Me.Controls.Add("forms.label.1")
' With Obj
' .Name = "lblPrenom" & i
' .Object.Caption = Sheets("Retards").Range("E" & i).Value
' .Left = Me.Controls("lblNom" & i).Left + Me.Controls("lblNom" & i).Width - 1
' .Top = 25 * i
' .Width = 150
' .Height = 20
' End With
' Next i
'
' For i = 2 To LineRetard
' Set Obj = Me.Controls.Add("forms.label.1")
' With Obj
' .Name = "lblDateCtrl" & i
' .Object.Caption = Sheets("Retards").Range("C" & i).Value
' .Left = Me.Controls("lblPrenom" & i).Left + Me.Controls("lblPrenom" & i).Width - 1
' .Top = 25 * i
' .Width = 80
' .Height = 20
' End With
' Next i
'
'Else
' MsgBox "Aucune ligne en cours"
'End If
'End Sub |
Partager