bonjour dans un esprit de simplifier aux maximum je cherche à mettre ceci dans une macro c'est dans userform
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Private Sub CommandButton4_Click() ''valider Enfant
    If Not IsDate(TextBox36.Value) Then
            MsgBox "Format incorrect"
            TextBox36 = ""
            Exit Sub
            Else
 
        End If
 
Dim Lg As Long
 
With Sheets("Cotisations") ' toutes les références précédées d'un point seront attachées à la feuille <liste>
  Lg = .Range("A65536").End(xlUp).Row + 1 ' détermine la 1ère cellule vide en colonne C (NOM)
 
  'Cells(Lg, 1) = date_du_jour ''''''''''''''''.Text = Format(Date_du_jour.Text, "DD/MM/YYYY")
 
  ligne = ActiveCell.Row ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''rajout
 
 
 
'''''''''''''''''''''''''''''''''''''enfant'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 If TextBox36.Value <> "" And TextBox35.Value <> "" And TextBox34.Value <> "" And CheckBox7.Value = False Then
 
 
  Cells(Lg, 1) = TextBox36.Value
  Cells(Lg, 4) = "Cotisations Enfant"
  Cells(Lg, 5) = TextBox35.Value
  Cells(Lg, 6) = TextBox34.Value
  Cells(Lg, 7) = Sheets("Tarif").Range("T3").Formula
  Cells(Lg, 8) = "Non"
  Cells(Lg + 1, 2).Select
 
 
 End If
 '''''''''''''''''''''''''''''''''''''enfant'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 If TextBox36.Value <> "" And TextBox35.Value <> "" And TextBox34.Value <> "" And CheckBox7.Value = True Then
 
 
  Cells(Lg, 1) = TextBox36.Value
  Cells(Lg, 4) = "Cotisations Enfant"
  Cells(Lg, 5) = TextBox35.Value
  Cells(Lg, 6) = TextBox34.Value
  Cells(Lg, 7) = Sheets("Tarif").Range("T4").Formula
  Cells(Lg, 8) = "Oui"
  Cells(Lg + 1, 2).Select
 
 
 End If
j'ai un message d'erreur objet requis
sur le premier texbox36 .Cela fonctionne dans userform mais pas dans une macro pouvez vous m'aidez ?