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 75 76 77 78 79 80 81 82 83
| Sub creation()
'Fonction permettant de créer une nouvelle ligne dans fichier Excel à partir du formulaire de création d'un nouvel enregistrement
Dim DerLig As Integer
Dim i As Integer
Application.ScreenUpdating = False
'Détermination de la dernière ligne remplie
DerLig = Range("A65536").End(xlUp).Row + 1
MsgBox "Ligne à remplir : " & DerLig
Application.ScreenUpdating = False
'If Ligne_Formulaire.TextQuestion.Value <> "" Then
Cells(DerLig, 1).Value = Ligne_Formulaire.TextQuestion.Value
'End If
If Ligne_Formulaire.TextDate1.Value <> "" Then
Cells(DerLig, 2).Value = Ligne_Formulaire.TextDate1.Value
End If
If Ligne_Formulaire.TextRefCourrier1.Value = "" Then
Cells(DerLig, 3).Value = Ligne_Formulaire.TextRefCourrier1.Value
End If
If Ligne_Formulaire.TextRefQuestion.Value = "" Then
Cells(DerLig, 4).Value = Ligne_Formulaire.TextRefQuestion.Value
End If
If Ligne_Formulaire.TextReponse.Value <> "" Then
Cells(DerLig, 5).Value = Ligne_Formulaire.TextReponse.Value
End If
If Ligne_Formulaire.TextRefCourrier2.Value <> "" Then
Cells(DerLig, 6).Value = Ligne_Formulaire.TextRefCourrier2.Value
End If
If Ligne_Formulaire.TextDate2.Value <> "" Then
Cells(DerLig, 7).Value = Ligne_Formulaire.TextDate2.Value
End If
'If Ligne_Formulaire.BoxProvenance.Value <> "" Then
Cells(DerLig, 8).Value = Ligne_Formulaire.BoxProvenance.Value
'End If
'If Ligne_Formulaire.BoxSite.Value <> "" Then
Cells(DerLig, 9).Value = Ligne_Formulaire.BoxSite.Value
'End If
If Ligne_Formulaire.BoxApplic.Value <> "" Then
Cells(DerLig, 10).Value = Ligne_Formulaire.BoxApplic.Value
End If
If Ligne_Formulaire.BoxCompetence.Value <> "" Then
Cells(DerLig, 11).Value = Ligne_Formulaire.BoxCompetence.Value
End If
If Ligne_Formulaire.txtCle1.Value <> "" Then
Cells(DerLig, 12).Value = Ligne_Formulaire.txtCle1.Value
End If
If Ligne_Formulaire.txtCle2.Value <> "" Then
Cells(DerLig, 13).Value = Ligne_Formulaire.txtCle2.Value
End If
If Ligne_Formulaire.txtCle3.Value <> "" Then
Cells(DerLig, 14).Value = Ligne_Formulaire.txtCle3.Value
End If
If Ligne_Formulaire.txtCle4.Value <> "" Then
Cells(DerLig, 15).Value = Ligne_Formulaire.txtCle4.Value
End If
If Ligne_Formulaire.BoxDossier.Value <> "" Then
Cells(DerLig, 16).Value = Ligne_Formulaire.BoxDossier.Value
End If
End Sub |
Partager