Userform donnees dans une feuille derniere ligne non vide
L
Bonjour,
J ai un petit soucis avec un userform que j ai creer pour alimenter une feuille avec les donnees qui sont selectionnes dans le userform.
Mais le probleme etant que les donnees ne s affichent pas...
Je ne comprend pas ce que j ai mal defini dans le code, j aurai besoin d un petit coup de pouce
Dim vcountry As Integer
Dim vcategory As Integer
Dim vscenario As Integer
Dim vsignature As Integer
Dim vproduct As Integer
Dim vcode As Integer
Dim vmonth As Integer
Dim vamount As Double
Dim vtype As Integer
Dim LR As Long
Dim WS As Worksheet
Option Explicit
Dim TabTemp As Variant
Private Sub CommandButton1_Click()
vcountry = ComboBox1
vcategory = ComboBox2
vscenario = ComboBox3
vsignature = ComboBox4
vproduct = ComboBox1
vcode = ComboBox9
vmonth = ComboBox6.Value
vamount = TextBox1.Value
vtype = ComboBox5.Value
Set WS = ActiveWorkbook.Sheets("COMPASS Extraction")
LR = WS.Range("A950000").End(xlUp).Row
WS.Cells(LR + 1, 1) = vcategory 'column A'
WS.Cells(LR + 1, 5) = vscenario 'column E'
WS.Cells(LR + 1, 8) = vsignature
WS.Cells(LR + 1, 10) = vproduct 'column J'
WS.Cells(LR + 1, 7) = vcode 'column G'
WS.Cells(LR + 1, 2) = vmonth 'column B'
WS.Cells(LR + 1, 4) = vcountry 'column D'
WS.Cells(LR + 1, 11) = vamount 'column K'
WS.Cells(LR + 1, 9) = vtype 'column I'
UserForm1.Hide
End Sub
Bonjour
Loupion a écrit :Mais le probleme etant que les donnees ne s affichent pas...
Pas de message d'erreur
J'ai fait un test en modifiant ton code et je n'ai pas de souci particulier
Option Explicit
Dim LR As Long
Dim WS As Worksheet
Dim TabTemp As Variant ' ????????
Private Sub CommandButton1_Click()
Set WS = ActiveWorkbook.Sheets("COMPASS Extraction")
LR = WS.Range("A" & Rows.Count).End(xlUp).Row
WS.Cells(LR + 1, 1) = Me.ComboBox2 ' column A'
WS.Cells(LR + 1, 5) = Me.ComboBox3 ' column E'
WS.Cells(LR + 1, 8) = Me.ComboBox4
WS.Cells(LR + 1, 10) = Me.ComboBox1 ' column J'
WS.Cells(LR + 1, 7) = Me.ComboBox9 ' column G'
WS.Cells(LR + 1, 2) = Me.ComboBox6 ' column B'
WS.Cells(LR + 1, 4) = Me.ComboBox1 ' column D'
WS.Cells(LR + 1, 11) = Me.TextBox1 ' column K'
WS.Cells(LR + 1, 9) = Me.ComboBox5 ' column I'
UserForm1.Hide
End Sub
Attention dans le code original
vcountry = ComboBox1
vproduct = ComboBox1
Lequel est le bon ?
Si pas ça