pasmermayvir
XLDnaute Junior
Bonjour le Forum
Dans un USF, après une recherche sur la colonne concernée, les valeurs de chaque ligne s'affiche dans la listbox pour la date du jour.
Comment transformer ce code pour que dans la listbox s'affiche les dates antérieures également....
Genre Dans la colonne R
ligne 1 = 03/07/08
ligne 2 = 26/06/08
ligne 3 = 14/08/08 là s'affiche avec mon code les valeurs pour 03/07/08
Comment afficher celles pour 26/06/08 et 03/07/08
MERCI POUR VOTRE AIDE .....
Private Sub UserForm_Initialize()
With ListBox1
.ColumnCount = 5
.ColumnWidths = "0cm;2cm;2cm;2cm;0cm"
End With
Label2.Caption = Format(Date, Today)
VSearch = Label2.Caption
For Each Feuille In ThisWorkbook.Worksheets
If Left(Feuille.Name, 1) = 2 Then
Derlig = Feuille.Range("R" & Rows.Count).End(xlUp).Row
For Each Cel In Feuille.Range("R3:R" & Derlig)
If Cel = VSearch Then
Me.ListBox1.AddItem Cel.Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Cel.Offset(0, -16)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Cel.Offset(0, -14)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Cel.Offset(0, -13)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Feuille.Name
End If
Next Cel
End If
Next Feuille
End Sub
Dans un USF, après une recherche sur la colonne concernée, les valeurs de chaque ligne s'affiche dans la listbox pour la date du jour.
Comment transformer ce code pour que dans la listbox s'affiche les dates antérieures également....
Genre Dans la colonne R
ligne 1 = 03/07/08
ligne 2 = 26/06/08
ligne 3 = 14/08/08 là s'affiche avec mon code les valeurs pour 03/07/08
Comment afficher celles pour 26/06/08 et 03/07/08
MERCI POUR VOTRE AIDE .....
Private Sub UserForm_Initialize()
With ListBox1
.ColumnCount = 5
.ColumnWidths = "0cm;2cm;2cm;2cm;0cm"
End With
Label2.Caption = Format(Date, Today)
VSearch = Label2.Caption
For Each Feuille In ThisWorkbook.Worksheets
If Left(Feuille.Name, 1) = 2 Then
Derlig = Feuille.Range("R" & Rows.Count).End(xlUp).Row
For Each Cel In Feuille.Range("R3:R" & Derlig)
If Cel = VSearch Then
Me.ListBox1.AddItem Cel.Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Cel.Offset(0, -16)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Cel.Offset(0, -14)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Cel.Offset(0, -13)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Feuille.Name
End If
Next Cel
End If
Next Feuille
End Sub