Private Sub DTPicker1_Change()
Dim data1 As String
Dim dl1 As Long ' dernière ligne
Select Case Month(DTPicker1.Value)
Case 1
ComboBox2.Value = "Janvier"
Case 2
ComboBox2.Value = "Fevrier"
Case 11
ComboBox2.Value = "Novembre"
End Select
Sheets(ComboBox2.Value).Select
dl1 = Sheets(ComboBox2.Value).Range("b65536").End(xlUp).Row
lig = chercheligne(ComboBox2.Value, ComboBox1.Value, "B4", "B" & dl1)
If lig = 0 Then lig = 3
data1 = colonneLCenAX(CLng(Day(DTPicker1.Value)) + 3) & lig
Range(data1).Select
End Sub
'---------------------------------------------------------------------------------------
' Procedure : colonneLCenAX
' DateTime : 09/01/2007 17:53
' Author : jp14
' Utilisation :transforme une valeur numérique en alpha
'colonneLCenAX(colonnen As Long)
'---------------------------------------------------------------------------------------
'
Function colonneLCenAX(colonnen As Long)
Dim ifo As Integer
If colonnen < (26 + 1) Then
colonneLCenAX = Chr(colonnen + 64)
Else
For ifo = 1 To 11
If colonnen > (ifo * 26) And colonnen < ((ifo + 1) * 26) + 1 Then colonneLCenAX = Chr(64 + ifo) & Chr(colonnen + 64 - (ifo * 26))
Next ifo
End If
End Function
'---------------------------------------------------------------------------------------
' Procedure : chercheligne
' DateTime : 22/03/2007 12:27
' Author : jp14
' Utilisation :Recherche simple avec Find
'Sheets().Range(colonne1a & "65536").End(xlUp).Row
'lig = chercheligne("Feuil1", "Valeur", "A1", "A" & dl1 )
'---------------------------------------------------------------------------------------
'
Function chercheligne(£feuille As String, £valeur As String, £col1d As String, £col1f As String)
Dim cel As Range
Set cel = Sheets(£feuille).Range(£col1d & ":" & £col1f).Find(What:=£valeur, LookIn:=xlValues, SearchOrder:=xlByRows)
If cel Is Nothing Then
chercheligne = 0
Else
chercheligne = cel.Row
End If
End Function