XL 2013 Copier coller avec conditions

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

tit32600

XLDnaute Nouveau
bonjour a tous

Je reviens vers vous,

dans mon fichier joint, je souhaiterais inscrire avec une macro vba dans ma feuille "Stock critique", la reference des articles de ma feuille "Stock" dont la valeur "Stock" est égal ou inférieure au stock critique

mais je suis pas excellent en vba, je l'avoue

merci encore

tit32600
 

Pièces jointes

Solution
Bonjour Tit,
Un exemple en PJ avec :
VB:
Sub Worksheet_Activate()
    Application.ScreenUpdating = False
    Range("A4:D1000").ClearContents
    IndexW = 4
    DL = Sheets("Stock").Range("A65500").End(xlUp).Row
    With Sheets("Stock")
        For i = 3 To DL
            If .Cells(i, "F") <= .Cells(i, "G") Then
                Cells(IndexW, "A") = .Cells(i, "D")     ' Désignation
                Cells(IndexW, "B") = .Cells(i, "C")     ' N° article
                Cells(IndexW, "C") = .Cells(i, "J")     ' Emplacement
                Cells(IndexW, "D") = .Cells(i, "F")     ' Stock
                IndexW = IndexW + 1
            End If
        Next i
    End With
End Sub
La macro s'exécute lorsqu'on sélectionne la feuille Stock...
Bonjour Tit,
Un exemple en PJ avec :
VB:
Sub Worksheet_Activate()
    Application.ScreenUpdating = False
    Range("A4:D1000").ClearContents
    IndexW = 4
    DL = Sheets("Stock").Range("A65500").End(xlUp).Row
    With Sheets("Stock")
        For i = 3 To DL
            If .Cells(i, "F") <= .Cells(i, "G") Then
                Cells(IndexW, "A") = .Cells(i, "D")     ' Désignation
                Cells(IndexW, "B") = .Cells(i, "C")     ' N° article
                Cells(IndexW, "C") = .Cells(i, "J")     ' Emplacement
                Cells(IndexW, "D") = .Cells(i, "F")     ' Stock
                IndexW = IndexW + 1
            End If
        Next i
    End With
End Sub
La macro s'exécute lorsqu'on sélectionne la feuille Stock critique.
 

Pièces jointes

Bonjour Tit,
Un exemple en PJ avec :
VB:
Sub Worksheet_Activate()
    Application.ScreenUpdating = False
    Range("A4:D1000").ClearContents
    IndexW = 4
    DL = Sheets("Stock").Range("A65500").End(xlUp).Row
    With Sheets("Stock")
        For i = 3 To DL
            If .Cells(i, "F") <= .Cells(i, "G") Then
                Cells(IndexW, "A") = .Cells(i, "D")     ' Désignation
                Cells(IndexW, "B") = .Cells(i, "C")     ' N° article
                Cells(IndexW, "C") = .Cells(i, "J")     ' Emplacement
                Cells(IndexW, "D") = .Cells(i, "F")     ' Stock
                IndexW = IndexW + 1
            End If
        Next i
    End With
End Sub
La macro s'exécute lorsqu'on sélectionne la feuille Stock critique.
salut sylvanu,

merci encore, cela me va tout a fait, cool

tit32600
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
3
Affichages
216
Retour