Lone-wolf
XLDnaute Barbatruc
Bonjour à toutes et à tous 🙂
Dans UsfModCommandes je n'arrive pas à modifier les lignes de commande dans la feuille Sauvegarde > Classeur Base.xls. Voici la dernière macro que j'ai essaié
À vous relire
Dans UsfModCommandes je n'arrive pas à modifier les lignes de commande dans la feuille Sauvegarde > Classeur Base.xls. Voici la dernière macro que j'ai essaié
VB:
Private Sub CmdFermer_Click()
Dim ligne&, j&, k&, Plage As Range, NC As Range, c As Range, Wf
With WsSav
Set Plage = .Range("b3:b65536")
For Each c In Plage
Set NC = WsFC.Range("g14")
If IsEmpty(c) Then Exit For
If IsNumeric(c) And c.Value Like "*" & NC.Value & "*" Then
For j = 18 To WsFC.Range("b40").End(xlUp).Row + 1
c.Offset(1, -1) = WsFC.Cells(j, 2)
c.Offset(1, 0) = WsFC.Cells(j, 3)
c.Offset(1, 1) = WsFC.Cells(j, 4)
c.Offset(1, 2) = WsFC.Cells(j, 5)
c.Offset(1, 3) = WsFC.Cells(j, 6)
c.Offset(1, 4) = WsFC.Cells(j, 7)
Next j
End If
Next c
End With
With WsStock
ligne = .Range("i65536").End(xlUp).Row
For k = 2 To ligne
.Cells(k, 9).ClearContents
Wf = WorksheetFunction.SumIf(WsDC.Range("c2:c65536"), .Cells(k, 3), WsDC.Range("d2:d65536"))
.Cells(k, 9).Value = Wf
If .Cells(k, 3) <> "" Then
.Cells(k, 11) = .Cells(k, 5) - .Cells(k, 9)
Else
Exit For
End If
Next k
End With
CmbCommandes = ""
CmbClients = ""
TxtDC = ""
TxtDL = ""
TxtDP = ""
TxtDLP = ""
CmbTP = ""
Unload Me
UsfCommandes.Show
End Sub
À vous relire