Bonjour!!
Nous avons un gros problème
Nous avons creer un userform, lorsque l'on valide cela nous insère une ligne au dessu d'un tableau (ce que l'on veut) mais cela ne reprend absolument pas la mise en forme du tableau...et ça malheureusement ca ne nous va pas....mais on ne sais pas comment faire pour corriger cela.... svp aidez nous )))
Private Sub Bt_Valider_Click()
Dim nr As Integer
If Me.UF_Listcli = "" Or Me.UF_Chantier = "" Or Me.UF_Nom = "" Or Me.UF_Adresse = "" Or Me.UF_Cp = "" Or Me.UF_Ville = "" Or Me.UF_Typecli = "" Or Me.UF_Com = "" Or Me.UF_ListDAS = "" Or Me.UF_Listtrav = "" Or Me.UF_MontTTC = "" Or Me.UF_ListtxTVA = "" Or Me.UF_MontTVA = "" Or Me.UF_MontHT = "" Or Me.UF_Date = "" Or Me.UF_Mois = "" Then
MsgBox "Saisir les champs incomplets"
GoTo Ending
Else
nr = 3
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 1).EntireRow.Insert 3
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 1) = UF_Chantier
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 2) = UF_Nom
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 3) = UF_Prénom
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 4) = UF_Adresse
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 5) = UF_Cp.Value
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 6) = UF_Ville
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 7) = UF_Typecli
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 8) = UF_Com
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 9) = UF_ListDAS
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 10) = UF_Listtrav
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 11) = Round(UF_MontTTC.Value, 2)
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 12) = (CDbl(UF_ListtxTVA.Value))
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 13) = Round(UF_MontTVA.Value, 2)
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 14) = Round(UF_MontHT.Value, 2)
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 15) = UF_Date.Value
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 16) = UF_Mois
Me.UF_Listcli = ""
Me.UF_Chantier = ""
Me.UF_Nom = ""
Me.UF_Prénom = ""
Me.UF_Adresse = ""
Me.UF_Cp = ""
Me.UF_Ville = ""
Me.UF_Typecli = ""
Me.UF_Com = ""
Me.UF_ListDAS = ""
Me.UF_Listtrav = ""
Me.UF_MontTTC = ""
Me.UF_ListtxTVA = ""
Me.UF_MontTVA = ""
Me.UF_MontHT = ""
Me.UF_Date = ""
Me.UF_Mois = ""
Me.UF_Listcli.SetFocus
Unload Me
End If
Ending:
End Sub
Nous avons un gros problème
Nous avons creer un userform, lorsque l'on valide cela nous insère une ligne au dessu d'un tableau (ce que l'on veut) mais cela ne reprend absolument pas la mise en forme du tableau...et ça malheureusement ca ne nous va pas....mais on ne sais pas comment faire pour corriger cela.... svp aidez nous )))
Private Sub Bt_Valider_Click()
Dim nr As Integer
If Me.UF_Listcli = "" Or Me.UF_Chantier = "" Or Me.UF_Nom = "" Or Me.UF_Adresse = "" Or Me.UF_Cp = "" Or Me.UF_Ville = "" Or Me.UF_Typecli = "" Or Me.UF_Com = "" Or Me.UF_ListDAS = "" Or Me.UF_Listtrav = "" Or Me.UF_MontTTC = "" Or Me.UF_ListtxTVA = "" Or Me.UF_MontTVA = "" Or Me.UF_MontHT = "" Or Me.UF_Date = "" Or Me.UF_Mois = "" Then
MsgBox "Saisir les champs incomplets"
GoTo Ending
Else
nr = 3
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 1).EntireRow.Insert 3
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 1) = UF_Chantier
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 2) = UF_Nom
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 3) = UF_Prénom
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 4) = UF_Adresse
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 5) = UF_Cp.Value
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 6) = UF_Ville
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 7) = UF_Typecli
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 8) = UF_Com
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 9) = UF_ListDAS
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 10) = UF_Listtrav
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 11) = Round(UF_MontTTC.Value, 2)
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 12) = (CDbl(UF_ListtxTVA.Value))
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 13) = Round(UF_MontTVA.Value, 2)
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 14) = Round(UF_MontHT.Value, 2)
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 15) = UF_Date.Value
ThisWorkbook.Sheets("Nouveaux Chantiers").Cells(nr, 16) = UF_Mois
Me.UF_Listcli = ""
Me.UF_Chantier = ""
Me.UF_Nom = ""
Me.UF_Prénom = ""
Me.UF_Adresse = ""
Me.UF_Cp = ""
Me.UF_Ville = ""
Me.UF_Typecli = ""
Me.UF_Com = ""
Me.UF_ListDAS = ""
Me.UF_Listtrav = ""
Me.UF_MontTTC = ""
Me.UF_ListtxTVA = ""
Me.UF_MontTVA = ""
Me.UF_MontHT = ""
Me.UF_Date = ""
Me.UF_Mois = ""
Me.UF_Listcli.SetFocus
Unload Me
End If
Ending:
End Sub