Gest_magasin Excel

Bonjour

Y a-t-il quelqu'un qui peut m'aider s'il vous plaît ?

Lorsque vous sélectionnez le code article dans la liste déroulante, il y a un espace vide dans la liste déroulante

Quelle est la cause du problème ?

Private Sub rayon_vente_Exit(ByVal Cancel As MSForms.ReturnBoolean) 'vente
  Dim i As Long, monproduit, lig As Integer
  If ctrl = True Then Exit Sub
  If Me.rayon_vente.ListIndex = -1 Then
     If [T_listrayon].Item(1, 1) = "" Then lig = 1 Else lig = [T_listrayon].Rows.Count + 1
     [T_listrayon].Item(lig, 1) = Me.rayon_vente
     tbl = [T_listrayon].Value
     Tri tbl, LBound(tbl), UBound(tbl), 1
     Me.Rayon.list = tbl
     Me.rayon_vente.list = tbl
  End If
 'Me.produit_vente.Clear
  monproduit = [Produits].Value
  For i = 1 To UBound(monproduit)
    If monproduit(i, 2) = Me.rayon_vente Then
      Me.produit_vente.AddItem monproduit(i, 3)
      Me.produit_vente.list(Me.produit_vente.ListCount - 1, 1) = i
      Me.ComboBox4.AddItem monproduit(i, 11)
      Me.ComboBox4.list(Me.ComboBox4.ListCount - 1, 1) = i
    End If
  Next i
 ' Me.ComboBox4.Clear

  'Me.prix_vente = "": Me.stock_vente = "": Me.TVAvente = "": Me.quantite_vente = ""
End Sub
12gest-magasin.xlsm (206.29 Ko)

Bonjour mody, le forum,

As-tu essayé de redimensionner ton tableau correctement,

image image

Inutile de laisser des lignes vides, le tableau s'adaptera à chaque ajout.

Cordialement,

7gest-magasin.xlsm (200.87 Ko)
C'est vrai xorsankukai
j'ai vu ça
Lorsque je clique dans la liste déroulante ( produit_vente ), cela augmente l'espace dans le contenu de la feuille qui lui est attribuée
Quel est le problème avec le code ?
Private Sub produit_vente_Change() 'vente
Dim rep As Byte
  If Me.produit_vente.ListIndex = -1 And Me.produit_vente = "" Then Exit Sub
  If Me.produit_vente.ListIndex = -1 And Me.produit_vente <> "" Then
    rep = MsgBox("Le produit doit être créé avec la page produit", vbCritical, "Contrôle")
    Exit Sub
  End If
  Me.enrgproduit = Me.produit_vente.Column(1)
  enreg = Val(Me.enrgproduit.Value)
  Me.stock_vente = [Produits].Item(enreg, 4)
  Me.TVAvente = [Produits].Item(enreg, 6)
  Me.prix_vente = Format([Produits].Item(enreg, 8), "#,##0.00")
  Me.mini_vente = [Produits].Item(enreg, 10)
  ComboBox4 = [Produits].Item(enreg, 11)
End Sub
compress 8866
Private Sub UserForm_Initialize()
  Dim c As Object, AL As Object, i As Long, d As Object
    tbl = [T_listrayon].Value '****************** Produits
    Tri tbl, LBound(tbl), UBound(tbl), 1
    Me.Rayon.list = tbl
    Me.rayon_vente.list = tbl
    tbl = [Client].Value '****************** Clients
    Tri tbl, LBound(tbl), UBound(tbl), 3
    Me.Recherche.list = tbl
    Me.nom_vente.list = tbl
    tbl = [T_Fournisseur].Value '****************** Fournisseur
    Tri tbl, LBound(tbl), UBound(tbl), 2
    Me.cherche_fournisseur.list = tbl
    Me.fournisseur.list = tbl
    Me.max_fournisseur = [T_Fournisseur].Rows.Count + 1
    Me.Scrollfournisseur.Max = Me.max_fournisseur
    Me.derenrg = [Produits].Rows.Count + 1
    Me.Scrollproduit.Max = Me.derenrg
    Me.derclient = [Client].Rows.Count + 1
    Me.ScrollClients.Max = Me.derclient
    Me.TxtDate = Format(Date, "dd/mm/yyyy")
End Sub
Rechercher des sujets similaires à "gest magasin"