Hi all,
I'm trying to put a combobox or something in a userform to allow the user to select the sheet where he wants to paste the values he put in the form. As of right now, I modified the sheet manually which isn't ideal.
The closest thing I saw to what I'm looking for is in this thread : VBA - Allow User to Select Which Worksheet to Copy but it's for copying and I don't know how to adapt it to the code below.
The following code is only execute once the user filled the forms with his data and click the "Add" button. Also to precise, all sheets have the same presentation.
Thanks to anyone that can help me or provide ideas.
I'm trying to put a combobox or something in a userform to allow the user to select the sheet where he wants to paste the values he put in the form. As of right now, I modified the sheet manually which isn't ideal.
The closest thing I saw to what I'm looking for is in this thread : VBA - Allow User to Select Which Worksheet to Copy but it's for copying and I don't know how to adapt it to the code below.
The following code is only execute once the user filled the forms with his data and click the "Add" button. Also to precise, all sheets have the same presentation.
Thanks to anyone that can help me or provide ideas.
VBA Code:
Private Sub BtnAdd_Click()
Sheets("DATA 20220516").Activate 'Sheet where the data is added
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
'Positionnement sur la dernière ligne
'Décalage d'une ligne vers le bas
ActiveCell = Txtid.Value
ActiveCell.Offset(0, 1).Value = cmbsoc
ActiveCell.Offset(0, 2).Value = TxtCV
ActiveCell.Offset(0, 3).Value = Cmbdiv
ActiveCell.Offset(0, 4).Value = CmbVend
ActiveCell.Offset(0, 5).Value = Txtref
ActiveCell.Offset(0, 6).Value = Txtpur
ActiveCell.Offset(0, 8).Value = Txtam
ActiveCell.Offset(0, 9).Value = txtdtd
ActiveCell.Offset(0, 10).Value = txtPdate
ActiveCell.Offset(0, 16).Value = CmbPO
ActiveCell.Offset(0, 18).Value = Txtcomm
ActiveCell.Offset(0, 19).Value = TxtCons
ActiveCell.Offset(0, 20).Value = Txtact
ActiveCell.Offset(0, 21).Value = TxtRes
ActiveCell.Offset(0, 22).Value = Txtissu
MsgBox "Nouvelle entrée prise en compte", vbOKOnly + vbInformation, "CONFIRMATION"
End Sub