Private Sub TextBox10_Change() TextBox10.Value = Now End Sub
Private Sub UserForm_Initialize() Dim Today Today = Now Me.Caption = Today Range("a1").Value = Today End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub CommandButton1_Click() Dim ctrl As Control Dim r As Integer Dim t As Integer Dim derligne As Integer With Worksheets("feuil1") derligne = .Range("B65536").End(xlUp).Row + 1 For Each ctrl In UserForm1.Controls On Error Resume Next r = Val(ctrl.Tag) If r > 0 Then Select Case r Case 6: Feuil1.Cells(derligne, r) = CDate(ctrl) Case 7: Feuil1.Cells(derligne, r) = CDate(ctrl) Case 8: Feuil1.Cells(derligne, r) = CInt(ctrl) Case 99: Hide Case Else: Feuil1.Cells(derligne, r) = ctrl End Select End If On Error GoTo 0 Next End With End End Sub Private Sub UserForm_Initialize() Dim tablo(), derligne As Integer Dim tablonb(), derlignenb As Integer Dim tablorest() As String Dim derlignerest As Integer 'spécifie la date du jour lors de l'affichage de l'USF MonthView1.Value = Now With Feuil2 derligne = .Range("B65536").End(xlUp).Row derlignenb = .Range("D65536").End(xlUp).Row derlignerest = .Range("C65536").End(xlUp).Row ReDim tablo(3 To derligne) ReDim tablonb(3 To derlignenb) ReDim tablorest(3 To derlignerest) For i = 3 To derligne tablo(i) = Format(.Range("B" & i), "hh:mm") Next i ComboBox3.List = tablo For n = 3 To derlignenb tablonb(n) = .Range("D" & n) Next n ComboBox4.List = tablonb For r = 3 To derlignerest tablorest(r) = .Range("C" & r) Next r ComboBox2.List = tablorest End With End Sub Private Sub TextBox1_Change() TextBox1.Value = WorksheetFunction.Proper(TextBox1.Value) End Sub Private Sub TextBox4_Change() TextBox4.Value = Format(TextBox4.Value, "00"" ""00"" ""00"" ""00"" ""00") End Sub Private Sub TextBox5_Change() TextBox5.Value = WorksheetFunction.Proper(TextBox5.Value) End Sub Private Sub MonthView1_DateClick(ByVal DateClicked As Date) TextBox2.Value = Format(DateClicked, "dd/mm/yyyy") TextBox6.Value = Format(DateClicked, "dddd dd mmmm yyyy") End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date) Dim Today As Date Dim DernLigne As Long Today = Now DernLigne = Range("A" & Rows.Count).End(xlUp).Row Range("A" & DernLigne).Select 'derniere ligne ActiveCell.Offset(1, 0).Value = Today 'affiche la date en dessous End Sub