Salut Ray,
ton fichier arrangé à ma sauce!
Lors du double-clic pour affichage de la date et heure, la macro décide toute seule comme une grande où afficher l'info et positionne le curseur sur la cellule "Systolique - Mesure 1".
Tu remarqueras que j'ai laissé un Popup auto-effaçable que tu as tant cherché dernièrement!
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim tSplit, iRow%, sCol$
'
If Target.Count > 1 Then Exit Sub
Cancel = True
'
If Target <> "" Then
CreateObject("Wscript.shell").Popup "La case est déjà remplie!", 2, "Message" ' La case est déjà remplie
Else
If Not Intersect(Target, Range("A2,A8,A14,A22,A28,A34,F2,F8,F14,F22,F28,F34")) Is Nothing Then
iRow = Target.Row
sCol = IIf(Time < 1 / 2, "A", "F") 'choix de l'avant-midi ou après-midi
Range(sCol & iRow).Font.Color = RGB(0, 0, 0)
Range(sCol & iRow).Value = WorksheetFunction.Proper(Format(Now, "dddd d mmmm yyyy & h:mm:ss"))
tSplit = Split(Range(sCol & iRow).Value, " ") 'affichage date avec lettres en rouge
For y = 0 To 4 Step 2
Range(sCol & iRow).Characters(InStr(Range(sCol & iRow).Value, tSplit(y)), 1).Font.Color = RGB(255, 0, 0)
Next
Range(sCol & iRow).Offset(1, 1).Select 'positionnement sur "Systolique - Mesure 1"
End If
End If
'
End Sub
Pour afficher ou non ton graphique, c'est plus court ainsi...
ActiveSheet.ChartObjects("Graphique 1").Visible = IIf(ActiveSheet.ChartObjects("Graphique 1").Visible = True, False, True)
Pour effacer les données...
With Worksheets("Mesures")
For x = 1 To 6
iRow = Choose(x, 2, 8, 14, 22, 28, 34)
Union(.Range("A" & iRow), .Range("F" & iRow), .Range("B" & iRow + 1 & ":D" & iRow + 3), .Range("G" & iRow + 1 & ":I" & iRow + 3)).Value = ""
Next
End With
A+