Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim I
    Dim Interval
    Dim texte
    Dim HZenith As String
    Dim EnsolPréc As Date
    Dim EnsolJour As Date
    Dim TS As ListObject
    Set TS = Sheets("Lune").ListObjects("t_Lune")
    If Target.Count > 1 Then Exit Sub
    If Intersect(Target, Range("Calendrier")) Is Nothing Then Exit Sub
    If Not IsNumeric(Left(Target, 1)) Or Target = "" Then Exit Sub
    With Forme
        .Hauteur_basse_mer_am = "": .Hauteur_pleine_mer_am = "": .Hauteur_basse_mer_ap = "": .Hauteur_pleine_mer_ap = ""
        .Lbl_MaréeJour = "": .Lbl_MaréeJour.ForeColor = -2147483630
        A = Year(Range("B1")): M = Month(Range("B1")): j = Left(Target, Len(Target) - InStr(Target, " ") + 1)
        vdate = DateSerial(A, M, j)
        fete (vdate)
        Mareee (vdate)
        With TS
            For I = 1 To .ListRows.Count
                Interval = DateDiff("d", vdate, .DataBodyRange(I, 2))
                Debug.Print Interval
                If Interval > 1 Then
                    texte = Hour(.DataBodyRange(I, 3)) & " h " & Minute(.DataBodyRange(I, 3)) & " min " & "dans " & Interval & " jours"
                    Forme.Label86.Caption = "( par rapport à la date sélectée )"
                ElseIf Interval = 1 Then
                    texte = Hour(.DataBodyRange(I, 3)) & " h " & Minute(.DataBodyRange(I, 3)) & " min " & "demain"
                    Forme.Label86.Caption = "( par rapport à la date sélectée )"
                ElseIf Interval = 0 Then
                    texte = Hour(.DataBodyRange(I, 3)) & " h " & Minute(.DataBodyRange(I, 3)) & " min "
                    Forme.Label86.Caption = "( par rapport à la date sélectée )"
                End If
                If Interval >= 0 Then
                    Select Case Asc(.DataBodyRange(I, 1))
                        Case 153
                            Forme.Lbl_NextLune = "Pleine Lune à " & texte
                        Case 130
                            Forme.Lbl_NextLune = "Premier Quartier à " & texte
                        Case 152
                            Forme.Lbl_NextLune = "Nouvelle Lune à " & texte
                        Case 131
                            Forme.Lbl_NextLune = "Dernier Quartier à " & texte
                    End Select
                    Exit For
                End If
            Next I
            ''''''''''''''''''''''''''''''''''''''''''''''''''''
        End With
        .Lbl_Jour.Caption = WorksheetFunction.Proper(Format(vdate, "dddd")) & " " & Format(vdate, "dd mmmm yyyy")
        .Lbl_NumSem.Caption = "Semaine n° " & DatePart("ww", vdate, vbMonday, vbFirstFourDays)
        .Tag = vdate
       
        .Départements = "(56) Morbihan"
        .VILLES = "Hennebont"
'        .Dates = vdate
'        If Hour(Now) >= .Matin_Basse And Hour(Now) <= .Matin_Haute Then .Etatmare = "Etat de la marée ( Montante )"
'        If Hour(Now) >= .Après_Basse And Hour(Now) <= .Après_Haute Then .Etatmare = "Etat de la marée ( Montante )"
'        If Hour(Now) >= .Matin_Haute And Hour(Now) <= .Après_Basse Then .Etatmare = "Etat de la marée ( Descendante )"
'        If Hour(Now) >= .Après_Haute And Hour(Now) <= .Matin_Basse Then .Etatmare = "Etat de la marée ( Descendante )"
        .Lbl_PosJour.Caption = DatePart("y", vdate) & " ème jour de l'année."
        DateDebut = vdate: DateFin = CDate("31/12/" & (A))
        NbJours = DateDiff("d", DateDebut, DateFin)
        .Lbl_NbJourRestant.Caption = NbJours & " jours restant."
        I = 1
        While Month(TS.DataBodyRange(I, 2)) <> Month(vdate)
            I = I + 1
        Wend
        For j = 1 To 5 'pour les 5 controls de lunaison
            If Month(TS.DataBodyRange(I + j - 1, 2)) = Month(vdate) Then
                .Controls("Lbl_Lunaison" & j).Visible = True
                Select Case TS.DataBodyRange(I + j - 1, 1)
                    Case Chr(130)
                        .Controls("Lbl_Lunaison" & j).Caption = "Premier Quartier"
                    Case Chr(131)
                        .Controls("Lbl_Lunaison" & j).Caption = "Dernier Quartier"
                    Case Chr(152)
                        .Controls("Lbl_Lunaison" & j).Caption = "Nouvelle Lune"
                    Case Chr(153)
                        .Controls("Lbl_Lunaison" & j).Caption = "Pleine Lune"
                End Select
                .Controls("Lunaison" & j).Visible = True
                .Controls("Lunaison" & j).Caption = TS.DataBodyRange(I + j - 1, 2)
            Else
                .Controls("Lbl_Lunaison" & j).Visible = False
                .Controls("Lunaison" & j).Visible = False
            End If
        Next j
        ExtraireLevercoucherDuSoleil (vdate - 1)
        EnsolPréc = Ensoleil
        ExtraireLevercoucherDuSoleil (vdate)
        EnsolJour = Ensoleil
        'Forme.Lbl_LeverSoleil = "Lever du soleil" & vbTab & vbTab & LeverTU
        Forme.Lbl_LeverSoleil = "Lever du soleil" & vbTab & vbTab & Format(LeverTU, "hh:mm")
        With Worksheets("MaPosition")
            If .cells(2, 2) = "" Then Forme.Lbl_LeverSoleil = "Lever du soleil"
        End With
        'Forme.Lbl_CoucherSoleil = "Coucher du soleil" & vbTab & CoucherTU
        Forme.Lbl_CoucherSoleil = "Coucher du soleil" & vbTab & Format(CoucherTU, "hh:mm")
        With Worksheets("MaPosition")
            If .cells(2, 2) = "" Then Forme.Lbl_CoucherSoleil = "Lever du soleil"
        End With
        'Forme.Lbl_Ensoleillement = "Ensoleillement " & vbTab & vbTab & EnsolJour
        Forme.Lbl_Ensoleillement = "Ensoleillement" & vbTab & vbTab & Format(EnsolJour, "hh:mm")
        With Worksheets("MaPosition")
            If .cells(2, 2) = "" Then Forme.Lbl_Ensoleillement = "Lever du soleil"
        End With
        Forme.dif_ensoleil = "(" & IIf(EnsolPréc > EnsolJour, "-", "+") & Format(Minute(EnsolPréc - EnsolJour), "0") & " min)"
        With Worksheets("MaPosition")
            If .cells(2, 2) = "" Then Forme.dif_ensoleil = ""
        End With
       
        HZenith = Format(ZenithTime(vdate, 3.36667), "hh:mm:ss")
        'Forme.Lbl_Zenith = "Zenith " & vbTab & vbTab & vbTab & HZenith
        Forme.Lbl_Zenith = "Zenith" & vbTab & vbTab & vbTab & Format(HZenith, "hh:mm")
        With Worksheets("MaPosition")
            If .cells(2, 2) = "" Then Forme.Lbl_Zenith = "Zenith"
        End With
        Forme.requête
        Tic
        Call JoursRestantsAvantProchaineSaison
    End With
    'Forme.Show
End Sub