Bonjour Franck Pijaku,
Désolé, j'y connais rien.
J'ai adapté le code par rapport au tien mais ça a été rejeté par un message "Mémoire insuffisante" en fermant le fichier sans sauvegarder celui-ci :-(((
MErci encore
à+
Voici le code que j'avais tapé :
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo Sortie
Application.EnableEvents = False
Set f2 = Sheets("Valeurs sauvegardées")
DerLig_f2 = f2.Range("A" & Rows.Count).End(xlUp).Row + 1
If Not Intersect(Target, Range("O4")) Is Nothing Then
Prenom = InputBox("C'est le bon prénom ?", "Vérification saisie", Range("I3").Value) 'prénom homme ! Range("I3")
f2.Cells(DerLig_f2, "A") = "Homme"
f2.Cells(DerLig_f2, "B") = Range("I3").Value 'Prénom
f2.Cells(DerLig_f2, "C") = Range("C3").Value 'Age
f2.Cells(DerLig_f2, "D") = Range("C4").Value 'Taille
f2.Cells(DerLig_f2, "E") = Date & " " & Format(Time, "HH:MM") 'Date et heure
f2.Cells(DerLig_f2, "F") = Range("F4").Value 'Tour de ventre
f2.Cells(DerLig_f2, "H") = Range("I4").Value 'Tour de cou
f2.Cells(DerLig_f2, "I") = Range("N4").Value * 100 'Pourcentage de graisse
f2.Cells(DerLig_f2, "J") = Range("L5").Value 'Morphotype
MsgBox "Valeurs ""Homme"" enregistrées"
ElseIf Not Intersect(Target, Range("O8")) Is Nothing Then
Prenom = InputBox("C'est le bon prénom ?", "Vérification saisie", Range("I8").Value)'prénom femme ! Range("I8")
f2.Cells(DerLig_f2, "A") = "Femme"
f2.Cells(DerLig_f2, "B") = Range("I7").Value 'Prénom
f2.Cells(DerLig_f2, "C") = Range("C7").Value 'Age
f2.Cells(DerLig_f2, "D") = Range("C8").Value 'Taille
f2.Cells(DerLig_f2, "E") = Date & " " & Format(Time, "HH:MM") 'Date et heure
f2.Cells(DerLig_f2, "F") = Range("F8").Value 'Tour de ventre
f2.Cells(DerLig_f2, "G") = Range("I8").Value 'Tour de hanche femme
f2.Cells(DerLig_f2, "H") = Range("L8").Value 'Tour de cou
f2.Cells(DerLig_f2, "I") = Range("N8").Value * 100 'Pourcentage de graisse
f2.Cells(DerLig_f2, "J") = Range("L9").Value 'Morphotype
MsgBox "Valeurs ""Femme"" enregistrées"
End If
Sortie:
Application.EnableEvents = True
End Sub