Private Sub trouve()
Set c = Feuil1.Range("A5:A35").Find(what:=CDate(Me.calendrier.Value), lookat:=xlWhole)
If Not c Is Nothing Then
Me.TextBox2.Value = c.Offset(, 1).Value
Else
MsgBox "non trouvé"
End If
End Sub
Private Sub calendrier_Change()
If Me.calendrier = "" Then Exit Sub
Call trouve
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
TextBox1.Value = TextBox1.Value + 1
End Sub
Private Sub CommandButton2_Click()
On Error Resume Next
TextBox1.Value = TextBox1.Value - 1
End Sub
Private Sub CommandButton3_Click()
Dim colonne As Integer, derligne As Integer, ctrl As Control, dmdrecues As Integer
'derligne devient la ligne qui suit la derniere valeur du tableau
derligne = Sheets("feuil1").Range("A560000").End(xlUp).Row + 1
'balaye les control un par un avec le for... next
For Each ctrl In formulaire.Controls
'la valeur de "colonne" est egale a la valeur du tag du controle
colonne = Val(ctrl.Tag)
'si la valeur du tag >0, l'intersection n°de derligne et n° de colonne est une cellule qui contiendra la valeur "ctrl"
'cad celle contenu dans le control
If colonne > 0 Then Sheets("feuil1").Cells(derligne, colonne) = ctrl
'next=> on passe au controle suivant
Next
End Sub
Private Sub UserForm_Initialize()
Me.calendrier = Format(Now, "dd/mm/yyyy")
Call trouve
End Sub