Bonjour, j'ai creer une USF ou il y a plusieurs textbox
j'aimerai copier ce qui je saisie dans ma textbox "TxtCodArt"
sur la textbox "TxtDscArt" et que cela l'affiche en reel
mais je ne sait pas comment faire
voici mon code, si quelqu'un pouvait m'aider:
Private Sub BtnCancel_Click()
Unload FrmArticle
End Sub
Private Sub BtnClear_Click()
Dim rep As Variant
If TxtCodArt = "" Then
MsgBox "Vous devez rentrer un code article pour pouvoir le supprimer.", vbInformation + vbOKOnly
Exit Sub
Else
rep = MsgBox("Etes-vous sur de vouloir supprimer l'article saisie ?", vbExclamation + vbYesNo)
If rep = vbYes Then
If Not ArticleExist(Me.TxtCodArt.Value) Then
MsgBox "Cet article n'existe pas, il ne peut donc pas être supprimé.", vbExclamation + vbOKOnly
Else
Sheets("Article").Rows(ArticleLigne(Me.TxtCodArt.Value)).Delete
Me.TxtCodArt = ""
Me.TxtDscArt = ""
Me.TxtCode = ""
Me.Txttva = ""
Me.CbxCat = ""
Me.Txtstock = ""
Me.Txtprix = ""
End If
End If
End If
End Sub
Private Sub BtnModif_Click()
Dim Row_art&
If ArticleExist(Me.TxtCodArt.Value) = True Then
Row_art = ArticleLigne(Me.TxtCodArt.Value)
With Sheets("Article")
.Cells(Row_art, 2).Value = Me.TxtDscArt
.Cells(Row_art, 3).Value = Me.TxtCode
.Cells(Row_art, 5).Value = Me.Txttva
.Cells(Row_art, 6).Value = Me.CbxCat
.Cells(Row_art, 7).Value = Me.Txtstock
.Cells(Row_art, 4).Value = Me.Txtprix
End With
Else
MsgBox "Cet article n'existe pas, il ne peut donc pas être modifié.", vbExclamation + vbOKOnly
End If
End Sub
Private Sub BtnSave_Click()
Dim Row_art&
If ArticleExist(Me.TxtCodArt.Value) = True Then
MsgBox "Cet article existe déjà, il ne peut donc pas être ajouté.", vbExclamation + vbOKOnly
Else
With Sheets("Article")
Row_art = .Range("A65536").End(xlUp).Row + 1
.Cells(Row_art, 1).Value = Me.TxtCodArt
.Cells(Row_art, 2).Value = Me.TxtDscArt
.Cells(Row_art, 3).Value = Me.TxtCode
.Cells(Row_art, 5).Value = Me.Txttva
.Cells(Row_art, 6).Value = Me.CbxCat
.Cells(Row_art, 7).Value = Me.Txtstock
.Cells(Row_art, 4).Value = Me.Txtprix
End With
End If
FrmArticle.Hide
End Sub
Private Sub TxtCodArt_Change()
TxtCodArt = UCase(TxtCodArt)
End Sub
Private Sub TxtCodArt_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim Row_art&
If ArticleExist(Me.TxtCodArt.Value) = True Then
Row_art = ArticleLigne(Me.TxtCodArt.Value)
With Sheets("Article")
Me.TxtDscArt = .Cells(Row_art, 2).Value
Me.TxtCode = .Cells(Row_art, 3).Value
Me.Txttva = .Cells(Row_art, 5).Value
Me.CbxCat = .Cells(Row_art, 6).Value
Me.Txtstock = .Cells(Row_art, 7).Value
Me.Txtprix = .Cells(Row_art, 4).Value
End With
End If
End Sub
Private Sub TxtCode_Change()
End Sub
Private Sub TxtDscArt_Change()
End Sub
Private Sub UserForm_Activate()
Dim i%, Dico, Dico_temp
With Sheets("Article")
Set Dico = CreateObject("Scripting.Dictionary")
For i = 2 To .Range("F65536").End(xlUp).Row
If Not Dico.Exists(.Range("F" & i).Value) Then
Dico.Add .Range("F" & i).Value, .Range("F" & i).Value
End If
Next i
End With
Let Dico_temp = Dico.Keys
Me.CbxCat.Clear
For i = 0 To Dico.Count - 1
If Dico_temp(i) <> "" Then Me.CbxCat.AddItem Dico_temp(i)
Next i
TxtDscArt.Text = ""
Txttva.Text = ""
'Txtcat.Text = ""
Txtstock.Text = ""
Me.Txtprix.Text = ""
End Sub
merci d'avance pour votre aide
j'aimerai copier ce qui je saisie dans ma textbox "TxtCodArt"
sur la textbox "TxtDscArt" et que cela l'affiche en reel
mais je ne sait pas comment faire
voici mon code, si quelqu'un pouvait m'aider:
Private Sub BtnCancel_Click()
Unload FrmArticle
End Sub
Private Sub BtnClear_Click()
Dim rep As Variant
If TxtCodArt = "" Then
MsgBox "Vous devez rentrer un code article pour pouvoir le supprimer.", vbInformation + vbOKOnly
Exit Sub
Else
rep = MsgBox("Etes-vous sur de vouloir supprimer l'article saisie ?", vbExclamation + vbYesNo)
If rep = vbYes Then
If Not ArticleExist(Me.TxtCodArt.Value) Then
MsgBox "Cet article n'existe pas, il ne peut donc pas être supprimé.", vbExclamation + vbOKOnly
Else
Sheets("Article").Rows(ArticleLigne(Me.TxtCodArt.Value)).Delete
Me.TxtCodArt = ""
Me.TxtDscArt = ""
Me.TxtCode = ""
Me.Txttva = ""
Me.CbxCat = ""
Me.Txtstock = ""
Me.Txtprix = ""
End If
End If
End If
End Sub
Private Sub BtnModif_Click()
Dim Row_art&
If ArticleExist(Me.TxtCodArt.Value) = True Then
Row_art = ArticleLigne(Me.TxtCodArt.Value)
With Sheets("Article")
.Cells(Row_art, 2).Value = Me.TxtDscArt
.Cells(Row_art, 3).Value = Me.TxtCode
.Cells(Row_art, 5).Value = Me.Txttva
.Cells(Row_art, 6).Value = Me.CbxCat
.Cells(Row_art, 7).Value = Me.Txtstock
.Cells(Row_art, 4).Value = Me.Txtprix
End With
Else
MsgBox "Cet article n'existe pas, il ne peut donc pas être modifié.", vbExclamation + vbOKOnly
End If
End Sub
Private Sub BtnSave_Click()
Dim Row_art&
If ArticleExist(Me.TxtCodArt.Value) = True Then
MsgBox "Cet article existe déjà, il ne peut donc pas être ajouté.", vbExclamation + vbOKOnly
Else
With Sheets("Article")
Row_art = .Range("A65536").End(xlUp).Row + 1
.Cells(Row_art, 1).Value = Me.TxtCodArt
.Cells(Row_art, 2).Value = Me.TxtDscArt
.Cells(Row_art, 3).Value = Me.TxtCode
.Cells(Row_art, 5).Value = Me.Txttva
.Cells(Row_art, 6).Value = Me.CbxCat
.Cells(Row_art, 7).Value = Me.Txtstock
.Cells(Row_art, 4).Value = Me.Txtprix
End With
End If
FrmArticle.Hide
End Sub
Private Sub TxtCodArt_Change()
TxtCodArt = UCase(TxtCodArt)
End Sub
Private Sub TxtCodArt_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim Row_art&
If ArticleExist(Me.TxtCodArt.Value) = True Then
Row_art = ArticleLigne(Me.TxtCodArt.Value)
With Sheets("Article")
Me.TxtDscArt = .Cells(Row_art, 2).Value
Me.TxtCode = .Cells(Row_art, 3).Value
Me.Txttva = .Cells(Row_art, 5).Value
Me.CbxCat = .Cells(Row_art, 6).Value
Me.Txtstock = .Cells(Row_art, 7).Value
Me.Txtprix = .Cells(Row_art, 4).Value
End With
End If
End Sub
Private Sub TxtCode_Change()
End Sub
Private Sub TxtDscArt_Change()
End Sub
Private Sub UserForm_Activate()
Dim i%, Dico, Dico_temp
With Sheets("Article")
Set Dico = CreateObject("Scripting.Dictionary")
For i = 2 To .Range("F65536").End(xlUp).Row
If Not Dico.Exists(.Range("F" & i).Value) Then
Dico.Add .Range("F" & i).Value, .Range("F" & i).Value
End If
Next i
End With
Let Dico_temp = Dico.Keys
Me.CbxCat.Clear
For i = 0 To Dico.Count - 1
If Dico_temp(i) <> "" Then Me.CbxCat.AddItem Dico_temp(i)
Next i
TxtDscArt.Text = ""
Txttva.Text = ""
'Txtcat.Text = ""
Txtstock.Text = ""
Me.Txtprix.Text = ""
End Sub
merci d'avance pour votre aide