bonjour mon problème est sur la création d'onglet la macro me produit 3 onglet et mes données ne s'enregistrent pas dans la fiche et mon second problème est quand je réalise la deuxième fiche
ci dessous mon code
merci de votre aide
je peux vous joindre mon fichier sur demande
cordialement
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 Private Sub CommandButton2_Click() 'Bouton VALIDER Dim NewLig As Long Dim c As Range With Sheets("Recap") NewLig = Application.Max(10, .Range("A" & Rows.Count).End(xlUp).Row + 1) .Range("A" & NewLig).Value = Application.WorksheetFunction.Max(Range("A:A")) + 1 .Range("C" & NewLig).Value = TextBoxobjet .Range("Y" & NewLig).Value = ComboBox4 .Range("Z" & NewLig).Value = TextBoxfiche .Range("AA" & NewLig).Value = CDate(TextBoxdate) .Range("AB" & NewLig).Value = TextBoximputation .Range("AC" & NewLig).Value = TextBoxlocalisation .Range("AD" & NewLig).Value = ComboBox1 .Range("D" & NewLig).Value = ComboBox1 .Range("AE" & NewLig).Value = TextBoxannée .Range("AF" & NewLig).Value = CheckBox1 .Range("AG" & NewLig).Value = CheckBox2 .Range("AH" & NewLig).Value = CheckBox3 .Range("AI" & NewLig).Value = TextBoxconstat .Range("AJ" & NewLig).Value = TextBoxrisque .Range("AK" & NewLig).Value = TextBoxorigine .Range("AL" & NewLig).Value = TextBoxconservatoires .Range("AM" & NewLig).Value = TextBoxtravaux .Range("AN" & NewLig).Value = TextBoxobservation .Range("AO" & NewLig).Value = TextBoxconstructeur .Range("AP" & NewLig).Value = TextBoxdureevie1 .Range("AQ" & NewLig).Value = TextBoxdureevie2 .Range("AR" & NewLig).Value = TextBoximage End With Application.ScreenUpdating = False 'On crée les onglets qui sont listés à partir de la cellule 'A2 de l'onglet nommé Liste Set c = Worksheets("RECAP").Range("B10") 'cellule de départ 'on copie le modèle en dernier Worksheets("TRAME").Copy After:=Worksheets(ThisWorkbook.Sheets.Count) With Worksheets(ThisWorkbook.Sheets.Count) 'avec l'onglet créé .Name = c.Value 'je renome 'Je remplit mon modèle comme je veut... .Range("B3") = TextBoxobjet .Range("A6") = TextBoxfiche .Range("B6") = TextBoxdate .Range("C6") = TextBoximputation .Range("D6") = TextBoxlocalisation .Range("E6") = ComboBox1 .Range("F6") = TextBoxannée .Range("G6") = ComboBox4 .Range("A9") = TextBoxconstat .Range("E11") = CheckBox1 .Range("E12") = CheckBox2 .Range("E13") = CheckBox3 .Range("A16") = TextBoxrisque .Range("A21") = TextBoxorigine .Range("A26") = TextBoxconservatoires .Range("A30") = TextBoxtravaux .Range("A35") = TextBoxobservation .Range("H15") = TextBoxconstructeur .Range("K17") = TextBoxdureevie1 .Range("K18") = TextBoxdureevie2 .Range("H20") = TextBoximage End With Application.ScreenUpdating = True Unload UserForm1 End Sub
Partager