XL 2013 Traduction code VBA

kidaas

XLDnaute Nouveau
Bonjour,
quelqu’un pourrait il me traduire ce "charabia" s'il vous plait?
merci
 

Pièces jointes

  • Nouveau Document Microsoft Word.docx
    15.1 KB · Affichages: 57

gilbert_RGI

XLDnaute Barbatruc
Re : Traduction code VBA

Bonjour,

sans connaitre le contenu de la feuille "référence" de ce classeur difficile de vous expliquer

mais en gros c'est du transfert de données d'une page à l'autre

avec des mises en forme de certaines cellules

et des positionnements de X

:p

c'est plus facile à lire comme ceci

VB:
Sub Planif()

'supprimer protection
'ActiveSheet.Unprotect

'fin

    Cells.Select
    Cells.FormatConditions.Delete

    C_ordre = 1
    C_sequence = 2
    C_operation = 3
    C_article = 4
    C_designation = 5
    L_planif = 4

    'nettoyage

    L_nett = 4
    L_deb = 4

    Do Until Cells(L_nett, C_ordre).Value = ""
        L_nett = L_nett + 1
    Loop

    Rows(L_deb & ":" & L_nett).Select
    Selection.Delete

    'nouvelle planification

    L_Ref = 2

    Do Until Sheets("Reference").Cells(L_Ref, 22).Value = ""

        If Sheets("Reference").Cells(L_Ref, 22).Value = Cells(1, 2).Value Then

            Cells(L_planif, C_ordre).Value = Sheets("Reference").Cells(L_Ref, 5).Value
            Cells(L_planif, C_sequence).Value = Sheets("Reference").Cells(L_Ref, 6).Value
            Cells(L_planif, C_operation).Value = Sheets("Reference").Cells(L_Ref, 7).Value
            Cells(L_planif, C_article).Value = Sheets("Reference").Cells(L_Ref, 3).Value
            Cells(L_planif, C_designation).Value = Sheets("Reference").Cells(L_Ref, 4).Value

            ligne = 3
            colonne = 6

            Do Until Cells(ligne, colonne).Value = "" Or Cells(ligne, colonne).Value = Sheets("Reference").Cells(L_Ref, 25).Value

                If Cells(ligne, colonne).Value = Sheets("Reference").Cells(L_Ref, 24).Value Then
                    Cells(L_planif, colonne).Value = "x"
                End If

                If Cells(L_planif, colonne - 1).Value = "x" Then
                    Cells(L_planif, colonne).Value = "x"
                End If

                colonne = colonne + 1
            Loop

            If Cells(ligne, colonne).Value = Sheets("Reference").Cells(L_Ref, 24).Value Or Cells(ligne, colonne).Value = Sheets("Reference").Cells(L_Ref, 25).Value Then
                Cells(L_planif, colonne).Value = "x"
            End If
            L_planif = L_planif + 1

        Else
        End If

        L_Ref = L_Ref + 1
    Loop

    Cells.Select
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
                                   Formula1:="=""x"""
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Font
        .ThemeColor = xlThemeColorLight2
        .TintAndShade = -0.249946592608417
    End With
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorLight2
        .TintAndShade = -0.249946592608417
    End With
    Selection.FormatConditions(1).StopIfTrue = False

    Cells.Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
                                   "=SI(ET($A1<>$A2;A$3<>"""";$A1<>""Poste :"");VRAI;FAUX)"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Borders(xlBottom)
        .LineStyle = xlContinuous
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.FormatConditions(1).StopIfTrue = False

    'selection pour impression

    ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(L_planif - 1, 26)).Address

    'protection
    'ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
     '        , AllowFormattingCells:=True, AllowSorting:=True, AllowFiltering:=True

    'fin

End Sub
 

kidaas

XLDnaute Nouveau
Re : Traduction code VBA

Merci Gilbert_RGI
j'aurai pu mettre en pj tout le fichier mais il fait 10Mo
voici une capture d'ecran de la feuille "reference". (si ca peut aider)
Merci
 

Pièces jointes

  • Capture.jpg
    Capture.jpg
    128.8 KB · Affichages: 68
  • Capture.jpg
    Capture.jpg
    128.8 KB · Affichages: 65

DevThomy

XLDnaute Nouveau
Re : Traduction code VBA

Bonjour.
Surement pas grand-chose.
Tu peux préciser un peu ta question pour que l’on puisse t’aidé ?
Mais si j’ai bien compris ta question d’en tu voudrais savoir ce que veut dire ces code ou bien comment faire ces code ?
 

kidaas

XLDnaute Nouveau
Re : Traduction code VBA

salut tout le monde :)
quelqu'un pourrait il me traduire cette formule svp?

=SIERREUR(SERIE.JOUR.OUVRE($AB$1;SOMME.SI($V$2:V3;V3;$N$2:N3)/(RECHERCHEV(V3;Ressources!I:p;8;FAUX))+0,01;Fermetures!A:A);"")

vous n'avez pas le fichier c'est peut être pas évident je ne sais pas mais j'aimerai juste la comprendre .
Merci
 

Discussions similaires

Statistiques des forums

Discussions
314 222
Messages
2 107 479
Membres
109 831
dernier inscrit
Alammo53