Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


A ma grande surprise le fichier avec ci-joint semble illisible.
Copie du code :
Public Sub JoursFeries()

    Dim vAnnee As Variant, DimanchePaques As Variant
    Dim G As Integer, C As Integer, C_4 As Integer, E As Integer
    Dim H As Integer, K As Integer, P As Integer, Q As Integer
    Dim I As Integer, B As Integer, J1 As Integer, J2 As Integer
    Dim R As Integer, lstJF(1 To 11) As Variant
    Dim MaZone As Object, MesColonnes As Object, MaFeuille As Object
    Dim Cellule As Object, MaColonne As Object

    vAnnee = InputBox(prompt:="Saisir l'année", Title:="Jour de paques")
    vAnnee = Cint(vAnnee)

    If vAnnee = "" Then
        Exit Sub
    End If

    G = vAnnee Mod 19
    C = vAnnee \ 100
    C_4 = C \ 4
    E = (8 * C + 13) \ 25
    H = (19 * G + C - C_4 - E + 15) Mod 30
    K = H \ 28
    P = 29 \ (H + 1)
    Q = (21 - G \ 11)
    I = (K * P * Q - 1) * K + H
    B = vAnnee \ 4 + vAnnee
    J1 = B + I + 2 + C_4 - C
    J2 = J1 Mod 7
    R = 28 + I - J2

    If R <= 31 Then
        DimanchePaques = DateValue(CStr(R) & "/3/" & CStr(vAnnee))
    Else
        DimanchePaques = DateValue(CStr(R - 31) & "/4/" & CStr(vAnnee))
    End If

    MaFeuille=ThisComponent.Sheets(0)

    '----------------- premier janvier ----------------------------------
    lstJF(1) = DateSerial(vAnnee, 1, 1)
    Cellule = MaFeuille.getCellRangeByName("A1")
    Cellule.Value = lstJF(1)
    '----------------- lundi de pâques ----------------------------------
    lstJF(2) = DateAdd("d", 1, DimanchePaques)
    Cellule = MaFeuille.getCellRangeByName("A2")
    Cellule.Value = lstJF(2)
    '----------------- premier mai --------------------------------------
    lstJF(3) = DateSerial(vAnnee, 5, 1)
    Cellule = MaFeuille.getCellRangeByName("A3")
    Cellule.Value = lstJF(3)
    '----------------- huit mai------- ----------------------------------
    lstJF(4) = DateSerial(vAnnee, 5, 8)
    Cellule = MaFeuille.getCellRangeByName("A4")
    Cellule.Value = lstJF(4)
     '----------------- jeudi de l'ascencion -----------------------------
    lstJF(5) = DateAdd("d", 39, DimanchePaques)
    Cellule = MaFeuille.getCellRangeByName("A5")
    Cellule.Value = lstJF(5)
    '----------------- lundi de pentecôte -------------------------------
    lstJF(6) = DateAdd("d", 50, DimanchePaques)
    Cellule = MaFeuille.getCellRangeByName("A6")
    Cellule.Value = lstJF(6)
    '----------------- 14 juillet ---------------------------------------
    lstJF(7) = DateSerial(vAnnee, 7, 14)
    Cellule = MaFeuille.getCellRangeByName("A7")
    Cellule.Value = lstJF(7)
    '----------------- 15 aout ------------------------------------------
    lstJF(8) = DateSerial(vAnnee, 8, 15)
    Cellule = MaFeuille.getCellRangeByName("A8")
    Cellule.Value = lstJF(8)
    '----------------- toussaint ----------------------------------------
    lstJF(9) = DateSerial(vAnnee, 11, 1)
    Cellule = MaFeuille.getCellRangeByName("A9")
    Cellule.Value = lstJF(9)
    '----------------- 11 novembre --------------------------------------
    lstJF(10) = DateSerial(vAnnee, 11, 11)
    Cellule = MaFeuille.getCellRangeByName("A10")
    Cellule.Value = lstJF(10)
    '----------------- noël ---------------------------------------------
    lstJF(11) = DateSerial(vAnnee, 12, 25)
    Cellule = MaFeuille.getCellRangeByName("A11")
    Cellule.Value = lstJF(11)

    MaColonne = MaFeuille.getCellRangeByName("colonne_A")

    With MaColonne
        .CellBackColor = RGB(100,220,220)
        .CharWeight = com.sun.star.awt.FontWeight.BOLD
          .CharPosture = com.sun.star.awt.FontSlant.ITALIC
          .CharFontName = "Comic Sans MS"
      End With



      MaZone = MaFeuille.getCellRangeByName("A1")
    MesColonnes = MaZone.Columns
    MesColonnes.OptimalWidth = True

End Sub

--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour savoir comment vous désinscrire
Les archives de la liste sont disponibles à http://listarchives.libreoffice.org/fr/users/
Tous les messages envoyés sur cette liste seront archivés publiquement et ne pourront pas être 
supprimés

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.