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 !
Salut Pex,
travaillant aussi dans les composites (methodes) et ayant creer moi meme un outils de gestion pour les composites, je regarde ca ce soir, et si je retrouve mon appli, je te la passerai 😉 (gestion de la matiere et de la MO suivant la taille de la piece, le procede utilisé, le renforts voulu, creation d un modele, d un moule .... jusqu a te donner un prix final par piece 😉
je reviens vers toi + tard 😉
Poto
et voilà ...
je me suis occupé seulement de l userform Consommable
tu verra c est tres simple une fois que t as la base ...
2/3 ptits trucs quand meme quand tu fais des userforms ...
prends l habitude de nommer tes differents elements ... l'userform lui meme, les textbox, les boutons ... c est bcp plus clair dans le code et c est surtout 10x plus facile a debugger qd t as un probleme ( et t aura forcement des problemes 😛 )
n'oublies pas de checker ton ordre de tabulation (où va aller le curseur quand tu appuies sur TAB... dans l editeur VBA, selectionne ton USF puis Affichage > Ordre de tabulation )
voila, amuses toi bien 😉
Poto
Private Sub ButtonSave_Click()
If TBNom = "" Or TBLocalisation = "" Or TBQuantite = "" Or TBFournisseur = "" Or TBRef = "" Then
MsgBox "Veuillez remplir toutes les informations demandées", , "Informations manquantes"
Exit Sub
End If
On Error Resume Next
ThisWorkbook.Sheets("consommable outillage").Range("B65536").End(xlUp).Offset(1, 0).Value = TBLocalisation
ThisWorkbook.Sheets("consommable outillage").Range("A65536").End(xlUp).Offset(1, 0).Value = TBNom
ThisWorkbook.Sheets("consommable outillage").Range("C65536").End(xlUp).Offset(1, 0).Value = TBQuantite
ThisWorkbook.Sheets("consommable outillage").Range("D65536").End(xlUp).Offset(1, 0).Value = TBRef
ThisWorkbook.Sheets("consommable outillage").Range("E65536").End(xlUp).Offset(1, 0).Value = TBFournisseur
Unload Me
On Error GoTo 0
End Sub
pour la date on ne peut pas mettre une liste défilante comme on a sur les forum pour s'inscrire ? et une fois que l'on clic sur enregistrer on a la date complète ex : "mardi 15 mars" dans le tableur ...
et dans le VBA j'ai une question :
comment faire pour le code pour dire sur chaque textbox si elle n'est pas rempli des information diverse au lieu d'avoir le meme message erreur au cas ou une seul valeur n'est pas rentré ..
If TBNom = "" Then
MsgBox "Veuillez remplir toutes les informations demandées", , "Informations manquantes" ''tache n°1
Exit Sub ''tache n°2
End If
''' puis
If TBLocalisation = "" Then
MsgBox "Veuillez remplir toutes les informations de localisation demandées", , "Informations de localisation manquantes"
Exit Sub
End If
''' et tu continu comme ca pour enchainer les tests de condition
cela serait pour avoir du style si le champ quantité n'est pas rempli :
" mettre une valeur gloable du nombre d'objet sous le format XXX-XXX " ( c'est a titre d’exemple après j'écrirai moi même l'avertissement )
If TBQuantite = "" Or isNumeric(TBQuantite)=false Then
MsgBox "Veuillez entrer une quantié", , "Informations manquantes" ''tache n°1
Exit Sub ''tache n°2
End If
Ah oui j'allais oublier, est-ce possible que lorsque quelqu’un utilise le fichier l'ouvre et enregistre quelque chose qu'il y ai une trace avec la date?
du style en ouvrant le fichiers une case lui demande des le debut son matricule . puis sans que la personne puisse voir, une feuille de classeur note ce matricule rentré précédemment avec la date et l'heure ?
lorsque que je clique sur enregistrer est il possible d'avoir une seconde boite de dialogue qui s'ouvre avec " voulez vous étes redirigé vers la page X ? " et deux boutons : " OK " , "annuler"
Sub test()
Dim Question As Long
Question = MsgBox("Voulez vous etre rediriger vers la page X ?", vbOKCancel, "Redirection")
If Question = vbOK Then
Sheets("presentation").Select
Else '' Si le test du dessus est = Faux alors executer ce qui suit
Exit Sub 'Sort du Sub
End If
End Sub
voila
Code:Sub test() Dim Question As Long Question = MsgBox("Voulez vous etre rediriger vers la page X ?", vbOKCancel, "Redirection") If Question = vbOK Then Sheets("presentation").Select Else '' Si le test du dessus est = Faux alors executer ce qui suit Exit Sub 'Sort du Sub End If End Sub
Pour ce qui est de faire une selection de date "Comme dans le forum quand on s inscrit..." regarde la solution de PierreJean ICI
je regarde pour le reste un peu plus tard
++
Poto
Private Sub quit_Click()
Unload Me
End Sub
Private Sub save_Click()
If nomduproduit = "" Or localisation = "" Or ref = "" Or reception = "" Or materiau = "" Or resine = "" Or stockage = "" Or Dreception = "" Or Dperemption = "" Then
MsgBox " Informations manquantes ", , " Informations manquantes "
Exit Sub
End If
If quantite = "" Or IsNumeric(quantite) = False Then
MsgBox "Veuillez entrer une quantité étant un chiffre ou un nombre", , "Erreur de saisie"
Exit Sub
End If
End Sub
Private Sub UserForm_Initialize()
Dreception.Value = Format(Date, "dd/mm/yyyy")
UserForm_Activate
Dperemption.Value = Format(Date, "dd/mm/yyyy")
UserForm_Activate
Dfabrication.Value = Format(Date, "dd/mm/yyyy")
UserForm_Activate
End Sub
Private Sub UserForm_Activate()
With Dreception
.SetFocus
.SelStart = 0
.SelLength = Len(Dreception)
End With
With Dperemption
.SetFocus
.SelStart = 0
.SelLength = Len(Dperemption)
End With
With Dfabrication
.SetFocus
.SelStart = 0
.SelLength = Len(Dfabrication)
End With
End Sub
Private Sub Dreception_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
calendrier_prepreg_reception.Show
End Sub
Private Sub Dperemption_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
calendrier_peremption_prepreg.Show
End Sub
Private Sub Dfabrication_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
calendrier_prepreg_fabrication.Show
End Sub
Private Sub continuer_Click()
Selection = DateValue(Dreception.Value)
Unload Me
End Sub
Selection = DateValue(Dperemption.Value)
Unload Me
End Sub
Selection = DateValue(Dfabrication.Value)
Unload Me
End Sub
On Error Resume Next
ThisWorkbook.Sheets("prépreg").Range("A65536").End(xlUp).Offset(1, 0).Value = localisation
ThisWorkbook.Sheets("prépreg").Range("B65536").End(xlUp).Offset(1, 0).Value = nomduproduit
ThisWorkbook.Sheets("prépreg").Range("C65536").End(xlUp).Offset(1, 0).Value = numeroclient
ThisWorkbook.Sheets("prépreg").Range("D65536").End(xlUp).Offset(1, 0).Value = numerosafran
ThisWorkbook.Sheets("prépreg").Range("E65536").End(xlUp).Offset(1, 0).Value = materiau
ThisWorkbook.Sheets("prépreg").Range("F65536").End(xlUp).Offset(1, 0).Value = typetissu
ThisWorkbook.Sheets("prépreg").Range("G65536").End(xlUp).Offset(1, 0).Value = resine
ThisWorkbook.Sheets("prépreg").Range("H65536").End(xlUp).Offset(1, 0).Value = stockage
ThisWorkbook.Sheets("prépreg").Range("I65536").End(xlUp).Offset(1, 0).Value = quantite
ThisWorkbook.Sheets("prépreg").Range("K65536").End(xlUp).Offset(1, 0).Value = Dreception
ThisWorkbook.Sheets("prépreg").Range("J65536").End(xlUp).Offset(1, 0).Value = Dfabrication
ThisWorkbook.Sheets("prépreg").Range("L65536").End(xlUp).Offset(1, 0).Value = Dperemption
ThisWorkbook.Sheets("prépreg").Range("N65536").End(xlUp).Offset(1, 0).Value = ref
ThisWorkbook.Sheets("prépreg").Range("O65536").End(xlUp).Offset(1, 0).Value = fabricant
ThisWorkbook.Sheets("prépreg").Range("P65536").End(xlUp).Offset(1, 0).Value = fournisseur
ThisWorkbook.Sheets("prépreg").Range("Q65536").End(xlUp).Offset(1, 0).Value = DMP
ThisWorkbook.Sheets("prépreg").Range("R65536").End(xlUp).Offset(1, 0).Value = reception
Unload Me
On Error GoTo 0
End Sub
Private Sub UserForm_Click()
End Sub
Option Explicit
Dim OptionChoisie As String
Private Sub quit_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dreception.Value = Format(Date, "dd/mm/yyyy")
UserForm_Activate
Dperemption.Value = Format(Date, "dd/mm/yyyy")
UserForm_Activate
End Sub
Private Sub UserForm_Activate()
With Dreception
.SetFocus
.SelStart = 0
.SelLength = Len(Dreception)
End With
With Dperemption
.SetFocus
.SelStart = 0
.SelLength = Len(Dperemption)
End With
End Sub
Private Sub Dreception_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
calendrier_conso_compo_recep.Show
End Sub
Private Sub Dperemption_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
calendrier_conso_compo_peremp.Show
End Sub
Private Sub continuer_Click()
Selection = DateValue(Dreception.Value)
Unload Me
End Sub
Selection = DateValue(Dperemption.Value)
Unload Me
End Sub
End Sub
Private Sub OBm²_Click()
If OBm² = True Then OptionChoisie = "m²"
End Sub
Private Sub OBLitre_Click()
If OBLitre = True Then OptionChoisie = "Litre"
End Sub
Private Sub OBGramme_Click()
If OBGramme = True Then OptionChoisie = "Gramme"
End Sub
Private Sub OBRouleau_Click()
If OBRouleau = True Then OptionChoisie = "Rouleau"
End Sub
Private Sub OBKg_Click()
If OBKg = True Then OptionChoisie = "Kg"
End Sub
Private Sub OBGallon_Click()
If OBGallon = True Then OptionChoisie = "Gallon"
End Sub
Private Sub OBEchantillon_Click()
If OBEchantillon = True Then OptionChoisie = "Echantillon"
End Sub
Private Sub save_Click()
If nomduproduit = "" Or localisation = "" Or fournisseur = "" Or reception = "" Then
MsgBox " veuillez saisir un maximum d'informations ", , " Informations manquantes "
Exit Sub
End If
If quantite = "" Or IsNumeric(quantite) = False Then
MsgBox "Veuillez entrer une quantité étant un chiffre ou un nombre", , "Erreur de saisie"
Exit Sub
End If
On Error Resume Next
ThisWorkbook.Sheets("consommable composite").Range("A65536").End(xlUp).Offset(1, 0).Value = localisation
ThisWorkbook.Sheets("consommable composite").Range("B65536").End(xlUp).Offset(1, 0).Value = nomduproduit
ThisWorkbook.Sheets("consommable composite").Range("C65536").End(xlUp).Offset(1, 0).Value = numeroclient
ThisWorkbook.Sheets("consommable composite").Range("D65536").End(xlUp).Offset(1, 0).Value = numerosafran
ThisWorkbook.Sheets("consommable composite").Range("E65536").End(xlUp).Offset(1, 0).Value = Dreception
ThisWorkbook.Sheets("consommable composite").Range("F65536").End(xlUp).Offset(1, 0).Value = Dperemption
ThisWorkbook.Sheets("consommable composite").Range("H65536").End(xlUp).Offset(1, 0).Value = quantite
ThisWorkbook.Sheets("consommable composite").Range("I65536").End(xlUp).Offset(1, 0).Value = OptionChoisie
ThisWorkbook.Sheets("consommable composite").Range("J65536").End(xlUp).Offset(1, 0).Value = utilisation
ThisWorkbook.Sheets("consommable composite").Range("K65536").End(xlUp).Offset(1, 0).Value = ref
ThisWorkbook.Sheets("consommable composite").Range("L65536").End(xlUp).Offset(1, 0).Value = fabricant
ThisWorkbook.Sheets("consommable composite").Range("N65536").End(xlUp).Offset(1, 0).Value = reception
ThisWorkbook.Sheets("consommable composite").Range("M65536").End(xlUp).Offset(1, 0).Value = fournisseur
ThisWorkbook.Sheets("consommable composite").Range("O65536").End(xlUp).Offset(1, 0).Value = Application.UserName
ThisWorkbook.Sheets("consommable composite").Range("P65536").End(xlUp).Offset(1, 0).Value = Now
Unload Me
On Error GoTo 0
End Sub
Private Sub UserForm_Click()
End Sub
We use cookies and similar technologies for the following purposes:
Est ce que vous acceptez les cookies et ces technologies?
We use cookies and similar technologies for the following purposes:
Est ce que vous acceptez les cookies et ces technologies?