bonjour, besoin d'aide sur la création d'une base de donnée via un formulaire,
la base de donnée est dans une feuille (base de donnée dans le classeur)
ci joint ma macro , il y a t il un passionné pour m'aider. merci
Private Sub CommandButton2_Click()
Dim nom As String
nom = TextBox1
If nom <> "" Then
Application.ScreenUpdating = False
Workbooks.Open Filename:=ThisWorkbook.Path & "\fiches indiv.xlsm"
Sheets("fiches indiv").Select
Sheets("fiches indiv").Copy After:=Workbooks("menu.xlsm").Sheets(Sheets.Count)
ActiveSheet.Name = nom
ActiveSheet.Range("D2") = nom
prenom = TextBox2
ActiveSheet.Range("F2") = prenom
grade = TextBox3
ActiveSheet.Range("B2") = grade
matricule = TextBox4
ActiveSheet.Range("H2") = matricule
Workbooks("fiches indiv").Close
Unload Me
Application.ScreenUpdating = True
End If
End Sub
la base de donnée est dans une feuille (base de donnée dans le classeur)
ci joint ma macro , il y a t il un passionné pour m'aider. merci
Private Sub CommandButton2_Click()
Dim nom As String
nom = TextBox1
If nom <> "" Then
Application.ScreenUpdating = False
Workbooks.Open Filename:=ThisWorkbook.Path & "\fiches indiv.xlsm"
Sheets("fiches indiv").Select
Sheets("fiches indiv").Copy After:=Workbooks("menu.xlsm").Sheets(Sheets.Count)
ActiveSheet.Name = nom
ActiveSheet.Range("D2") = nom
prenom = TextBox2
ActiveSheet.Range("F2") = prenom
grade = TextBox3
ActiveSheet.Range("B2") = grade
matricule = TextBox4
ActiveSheet.Range("H2") = matricule
Workbooks("fiches indiv").Close
Unload Me
Application.ScreenUpdating = True
End If
End Sub