Un probleme de code

cs_Delphine_P Messages postés 3 Date d'inscription mercredi 29 novembre 2006 Statut Membre Dernière intervention 15 mai 2007 - 10 févr. 2007 à 16:22
cs_Delphine_P Messages postés 3 Date d'inscription mercredi 29 novembre 2006 Statut Membre Dernière intervention 15 mai 2007 - 15 mai 2007 à 07:02
Bonjour, je ne suis pas sur que mon thème, mais je suis une vrais débutante.
tout d'abord je voulais vous dire que votre site est très bien, même si j'ai un peux de mal à comprendre les codes.
Mon problème est le suivant, je vous donne les codes sa sera plus facile pour expliquer:

Sub Bouton2_QuandClic()


pprod = Range("b3").Value
op = Range("b4").Value
vvaleur = Range("b5").Value
ddate = Range("b6").Value
vdiff = Range("b9").Value



If op "" Or vvaleur "" Or ddate = "" Or pprod = "" Then
MsgBox ("Toutes les zones VERTES doivent être renseignées")
Exit Sub
End If


If op <> "Commande" Then


    rep = MsgBox("Vous allez mettre à jour le stock, Voulez vous continuer ?", vbYesNo)
   
    If rep = vbYes Then
    Range("b4:b6").ClearContents
        Worksheets("Produits Référencés").Select
        Cells.Find(What:=pprod, After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlWhole, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate


        If op = "Inventaire" Then
        Cells(ActiveCell.Row, 2).Value = vvaleur
        lili1 = ActiveCell.Row
        lili2 = ActiveCell.Row + 79
        Worksheets("Recap stock").Select
        Cells.Find(What:=ddate, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
            If ActiveCell.Row = 1 Then
            Cells(lili1, ActiveCell.Column).Value = Cells(lili1, ActiveCell.Column).Value + vdiff
            Else
            Cells(lili2, ActiveCell.Column).Value = Cells(lili2, ActiveCell.Column).Value + vdiff
            End If
        End If


        If op = "Entrée" Then
        Cells(ActiveCell.Row, 2).Value = Cells(ActiveCell.Row, 2).Value + vvaleur
        lili1 = ActiveCell.Row
        lili2 = ActiveCell.Row + 79
        Worksheets("Recap stock").Select
        Cells.Find(What:=ddate, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
            If ActiveCell.Row = 1 Then
            Cells(lili1, ActiveCell.Column).Value = Cells(lili1, ActiveCell.Column).Value + vvaleur
            Else
            Cells(lili2, ActiveCell.Column).Value = Cells(lili2, ActiveCell.Column).Value + vvaleur
            End If
        End If


        If op = "Sortie" Then
        Cells(ActiveCell.Row, 2).Value = Cells(ActiveCell.Row, 2).Value - vvaleur
        lili1 = ActiveCell.Row
        lili2 = ActiveCell.Row + 79
        Worksheets("Recap stock").Select
        Cells.Find(What:=ddate, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
            If ActiveCell.Row = 1 Then
            Cells(lili1, ActiveCell.Column).Value = Cells(lili1, ActiveCell.Column).Value - vvaleur
            Else
            Cells(lili2, ActiveCell.Column).Value = Cells(lili2, ActiveCell.Column).Value - vvaleur
            End If
        End If


    End If
    Worksheets(3).Select
   
Else


    rep2 = MsgBox("Vous allez mettre à jour les commandes, Voulez vous continuer ?", vbYesNo)
    If rep2 = vbYes Then
        Range("b4:b6").ClearContents
        Worksheets("Commande").Select
        Range("a1").Activate
       
        Cells.Find(What:=pprod, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
       
        Cells(ActiveCell.Row, 2).Value = ddate
        Cells(ActiveCell.Row, 3).Value = vvaleur
        Cells(ActiveCell.Row, 4).Value = "Non"
      End If
End If


End Sub

C'est des codes pour faire un stock et sur ma feuille de récapitulatif des stocks sur l'exemple, les produits sont en ligne et les dates en colonne, le problème il me prend d'une année alors je voudrais changer la date en ligne et les produits en colonne. Sa fait une semaine que j'y suis dessus et je n'arrive pas à changer les codes.
Pouvez vous m'aidez
Merci d'avance de votre réponse.
Cordialement
Delphine_P

4 réponses

VBGenesis Messages postés 292 Date d'inscription samedi 25 février 2006 Statut Membre Dernière intervention 22 février 2009
10 févr. 2007 à 18:21
Met des commentaires dans ton code, pour comprendre à quoi sert chaque partie du codes et chaque variable, et dis nous quel controle de tableau tu utilise stp (car on parle bien d'un tableau non)
Pense aussi a mettre un titre plus explicit la prochaine fois
VBGenesis
0
cs_Delphine_P Messages postés 3 Date d'inscription mercredi 29 novembre 2006 Statut Membre Dernière intervention 15 mai 2007
11 févr. 2007 à 07:53
Bonjour,


Merci de votre réponse, mais sa va être difficile pour moi de vous expliquer les code car j'ai du mal à les comprendre, car se n'est pas moi qui l'est fait.


C'est pour un tableau excel, avec Visual Basic.
 Dans ce tableau 4 feuilles : commande, saisie , produit de référence, récapitulatif stock.


D'après se que j'ai compris ce code est pour la feuille "saisie" des articles, C'est ce que j'aimerais changer.


<colgroup>
<col style=\"WIDTH: 113pt; mso-width-source: userset; mso-width-alt: 5522\" width=\"151\" />
<col style=\"WIDTH: 181pt; mso-width-source: userset; mso-width-alt: 8813\" width=\"241\" />
</colgroup>

----

Exemple suivant:,

,

----

Produit,
2519 Masque purifiant,

----

Opération,
 entrée,

----

Quantité,
 1,

----

Date,
 11/02/2007,

----

,

,

----

Stock actuel,
0,

----

Mouvement,
+ 0 ,

----

Stock après mouvement,
0,

----

,

,

----

Stock critique,
1

Cette parti correspond à basculer les chiffres dans produits de référencement qui est bon pour moi.



Sub Bouton2_QuandClic()pprod = Range("b3").Value
op = Range("b4").Value
vvaleur = Range("b5").Value
ddate = Range("b6").Value
vdiff = Range("b9").Value
If op "" Or vvaleur "" Or ddate = "" Or pprod = "" Then
MsgBox ("Toutes les zones VERTES doivent être renseignées")
Exit Sub
End If

If op <> "Commande" Then

    rep = MsgBox("Vous allez mettre à jour le stock, Voulez vous continuer ?", vbYesNo)
   
    If rep = vbYes Then
    Range("b4:b6").ClearContents
        Worksheets("Produits Référencés").Select
        Cells.Find(What:=pprod, After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlWhole, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate

      If op = "Inventaire" Then
        Cells(ActiveCell.Row, 2).Value = vvaleur
        lili1 = ActiveCell.Row
        lili2 = ActiveCell.Row + 79
C'est a partir de la  que sa me pose un probleme, il faut que quand j'utilise op "b4" qui correspond à "inventaire,entrée, sortie". Quand je valide par un boutons pour placer les chiffres dans "récap stock" les chiffres se mettent comme cela:
<colgroup><col style=\"WIDTH: 224pt; mso-width-source: userset; mso-width-alt: 10898\" width=\"298\" /><col style=\"WIDTH: 38pt; mso-width-source: userset; mso-width-alt: 1828\" width=\"50\" /><col style=\"WIDTH: 40pt; mso-width-source: userset; mso-width-alt: 1938\" span=\"3\" width=\"53\" /><col style=\"WIDTH: 39pt; mso-width-source: userset; mso-width-alt: 1901\" width=\"52\" /><col style=\"WIDTH: 40pt; mso-width-source: userset; mso-width-alt: 1938\" width=\"53\" /></colgroup>----<?xml:namespace prefix v ns "urn:schemas-microsoft-com:vml" /??><v:shapetype id="_x0000_t201" path="m,l,21600r21600,l21600,xe" o:spt="201" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:path o:connecttype="rect" fillok="f" strokeok="f" o:extrusionok="f" shadowok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /??><o:lock shapetype="t" v:ext="edit"></o:lock></v:shapetype><v:shape id="_x0000_s6145" style="MARGIN-TOP: 6pt; Z-INDEX: 1; MARGIN-LEFT: 34.5pt; WIDTH: 134.25pt; POSITION: absolute; HEIGHT: 16.5pt; mso-wrap-style: tight" o:insetmode="auto" strokecolor="windowText [64]" fillcolor="buttonFace [67]" o:button="t" type="#_x0000_t201"><v:fill o:detectmouseclick="t" color2="buttonFace [67]"></v:fill><o:lock v:ext="edit" rotation="t"></o:lock><v:textbox style="mso-direction-alt: auto" o:singleclick="f"></v:textbox></v:shape><table cellspacing="0" cellpadding="0">----, </td>
</td><td class="xl25" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 38pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" width="50" x="">01-janv</td><td class="xl25" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 40pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" width="53" x="">02-janv</td><td class="xl25" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 40pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" width="53" x="">03-janv</td><td class="xl25" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 40pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" width="53" x="">04-janv</td><td class="xl25" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 39pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" width="52" x="">05-janv</td><td class="xl25" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 40pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" width="53" x="">06-janv</td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">0141 Formule 1 - vanille</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">0142 Formule 1 - chocolat</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">0143 Formule 1 - Fraise</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">0144 Formule 1 - fruit tropical</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">1171 Formule 1 - cappuccino</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">1 </td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">-1 </td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">0242 formule 3 - proteine</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">1 </td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">3114 Compl. alim. fibre</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">1 </td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">-1 </td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">3122 Formule 2 - vitamine</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">2 </td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">-1 </td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" align="right" x="">-1 </td></tr><tr style="HEIGHT: 12.75pt" height="17"><td style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height="17">4769 QuickStart - vanille</td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td><td class="xl26" style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent"></td></tr></tbody></table>
Mais moi j'aimerais inverser les produits en colonne et la date en ligne. Je pense que c'est le code si dessus qu'il faut rectifier, mais je n'est pas trouvé.
Pour les feuilles entrée et sortie même problème, enfin si un est changer les autre seront pareille.

        Worksheets("Recap stock").Select
        Cells.Find(What:=ddate, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate

Ici , J'ai essayer de changer ROW par COLUMN

            If ActiveCell.Row = 1 Then

Et La COLUMN par ROW, mais il me dit qu'il y a une erreur au niveaux de Cells.Find(What:=pprod, After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlWhole, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate

            Cells(lili1, ActiveCell.Column).Value = Cells(lili1, ActiveCell.Column).Value + vdiff
            Else
            Cells(lili2, ActiveCell.Column).Value = Cells(lili2, ActiveCell.Column).Value + vdiff
            End If
        End If

        If op = "Entrée" Then
        Cells(ActiveCell.Row, 2).Value = Cells(ActiveCell.Row, 2).Value + vvaleur
        lili1 = ActiveCell.Row
        lili2 = ActiveCell.Row + 79
        Worksheets("Recap stock").Select
        Cells.Find(What:=ddate, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
            If ActiveCell.Row = 1 Then
            Cells(lili1, ActiveCell.Column).Value = Cells(lili1, ActiveCell.Column).Value + vvaleur
            Else
            Cells(lili2, ActiveCell.Column).Value = Cells(lili2, ActiveCell.Column).Value + vvaleur
            End If
        End If

        If op = "Sortie" Then
        Cells(ActiveCell.Row, 2).Value = Cells(ActiveCell.Row, 2).Value - vvaleur
        lili1 = ActiveCell.Row
        lili2 = ActiveCell.Row + 79
        Worksheets("Recap stock").Select
        Cells.Find(What:=ddate, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
            If ActiveCell.Row = 1 Then
            Cells(lili1, ActiveCell.Column).Value = Cells(lili1, ActiveCell.Column).Value - vvaleur
            Else
            Cells(lili2, ActiveCell.Column).Value = Cells(lili2, ActiveCell.Column).Value - vvaleur
            End If
        End If

    End If
    Worksheets(3).Select
   
Else

    rep2 = MsgBox("Vous allez mettre à jour les commandes, Voulez vous continuer ?", vbYesNo)
    If rep2 = vbYes Then
        Range("b4:b6").ClearContents
        Worksheets("Commande").Select
        Range("a1").Activate
       
        Cells.Find(What:=pprod, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
       
        Cells(ActiveCell.Row, 2).Value = ddate
        Cells(ActiveCell.Row, 3).Value = vvaleur
        Cells(ActiveCell.Row, 4).Value = "Non"
      End If
End If

End Sub

Voilà, j'espère que j'ai réussi à vous expliquez mon problème et je suis désolé si mes expliquation sont pas très claire, mais j'ai beaucoup de mal avec tous ses codes. j'espère que vous pourrez m'aider. je vous en remerci d'avance.
Cordialement
Delphine_P
0
funkateer1972 Messages postés 1 Date d'inscription dimanche 13 mai 2007 Statut Membre Dernière intervention 13 mai 2007
13 mai 2007 à 19:38
Bonjour Delphine,

J'utilise aussi les même codes et il bloque avec' une erreur de compilation Argument nommé introuvable' avec SearchFormat:=False surligné.

As tu uen solution à m'indiquer stp
0
cs_Delphine_P Messages postés 3 Date d'inscription mercredi 29 novembre 2006 Statut Membre Dernière intervention 15 mai 2007
15 mai 2007 à 07:02
Bonjour funkateer,

Je n'est pas trouvé de solution, car je n'est eu aucune réponse à ma demande.
Alors j'ai laissé tomber, je reporte tous sur une autre feuille sa fait 2 fois + de travaille.
Je suis désoler de ne pouvoir t'aider.
Bonne journée.
Delphine
0
Rejoignez-nous