Code VBA d'envoi

jeanluc67

XLDnaute Nouveau
Option Explicit

Private Sub cmdEnvoi_Click()

Bonjour,
Voici un code avec une erreur pour l'envoi des données dans le tableau ligne par ligne.


Dim AA As Integer
AA = Range("A2").Value
Dim i As Integer
Dim WSR As Worksheet

Set WSR = Sheets(AA)

i = WSR.Range("A65536").End(xlUp).Row + 1

WSR.Range("A" & i) = txtDate
WSR.Range("B" & i) = ComboBox1
WSR.Range("C" & i) = txtProduit
WSR.Range("D" & i) = txtNumC
WSR.Range("E" & i) = txtNumL
WSR.Range("F" & i) = txtNumB
WSR.Range("G" & i) = TextBox1
Clean
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub Clean()
Dim CTRL As Control

For Each CTRL In Controls
If TypeOf CTRL Is MSForms.TextBox Then CTRL.Value = ""
Next CTRL
End Sub

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()

End Sub

Private Sub CommandCalendrier1_Click()
usfPos1.Show
End Sub

Private Sub CommandCalendrier_Click()

End Sub

Private Sub Label1_Click()

End Sub

Private Sub TextBox1_Change()

End Sub

Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
txtDate.Value = DateClicked
End Sub


Private Sub TextBox2_Change()

End Sub

Private Sub txtDate_Change()

End Sub

Private Sub txtNumB_Change()

End Sub

Private Sub txtNumL_Change()

End Sub

Private Sub txtProduit_Change()

End Sub

Private Sub UserForm_Initialize()
txtDate = Date
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 686
Messages
2 090 949
Membres
104 705
dernier inscrit
Mike72