Private Sub CommandButton2_Click()
Select Case Month(MonthView1.Value)
Case 1
NomFichier = "01-jan.xls"
Case 2
NomFichier = "02-fev.xls"
Case 3
NomFichier = "03-mar.xls"
Case 4
NomFichier = "04-avr.xls"
Case 5
NomFichier = "05-mai.xls"
Case 6
NomFichier = "06-jui.xls"
Case 7
NomFichier = "07-jui.xls"
Case 8
NomFichier = "08-aou.xls"
Case 9
NomFichier = "09-sep.xls"
Case 10
NomFichier = "10-oct.xls"
Case 11
NomFichier = "11-nov.xls"
Case 12
NomFichier = "12-dec.xls"
End Select
chemin = "\\"
Workbooks.Open (chemin & NomFichier)
colonnspv = Day(MonthView1) * 4 + 3
Label30.Caption = Cells(13, colonnspv + 4).Text
With Sheets(1)
For f = 4 To 58
If .Cells(f, colonnspv + 1) = "SO" Or .Cells(f, colonnspv + 1) = "HDJ" Or .Cells(f, colonnspv + 1) = "HD" Then
V1 = V1 & Cells(f, 3) & "." & Cells(f, 4) & Chr(10)
Label27.Caption = V1
End If
If .Cells(f, colonnspv + 1) = "X" Then
V5 = V5 & Cells(f, 3) & "." & Cells(f, 4) & Chr(10)
Label39.Caption = V5
End If
If .Cells(f, colonnspv + 3) = "HDN" Or .Cells(f, colonnspv + 3) = "SON" Or .Cells(f, colonnspv + 3) = "HD" Then
V3 = V3 & Cells(f, 3) & "." & Cells(f, 4) & Chr(10)
Label28.Caption = V3
End If
If .Cells(f, colonnspv + 3) = "X" Then
V6 = V6 & Cells(f, 3) & "." & Cells(f, 4) & Chr(10)
Label40.Caption = V6
End If
If .Cells(f, colonnspv + 4) = "HDN" Or .Cells(f, colonnspv + 4) = "SON" Or .Cells(f, colonnspv + 3) = "HD" Then
V4 = V4 & Cells(f, 3) & "." & Cells(f, 4) & Chr(10)
Label29.Caption = V4
End If
If .Cells(f, colonnspv + 4) = "X" Then
V7 = V7 & Cells(f, 3) & "." & Cells(f, 4) & Chr(10)
Label41.Caption = V7
End If
Next
End With
Workbooks(NomFichier).Close SaveChanges:=False
End Sub
[\code]