J'ai un problème pour exécuter le UserForm que j'ai créé. J'ai 5 étiquettes dans mon UserForm, mais lorsque j'exécute le UserForm pour obtenir l'entrée pour la feuille de calcul Excel, mes étiquettes ne s'affichent pas, seulement les dates, les chiffres, etc. que j'ai mis dans les zones de texte et les comboboxes. Quelqu'un connaît-il la solution à ce problème ?
Private Sub btncalculate_Click()
txtactualprofit = txtincome - txtexpenses
End Sub
Private Sub btncancel_Click()
Unload Me
End Sub
Private Sub btnreset_Click()
Unload UserForm1
UserForm1.Show
End Sub
Private Sub btnsubmit_Click()
Dim emptyRow As Long
'Make Sheet2 active
Sheet2.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 2
'Transfer information
Cells(emptyRow, 1).Value = cmbmonth.Value & "/" & cmbyear.Value
Cells(emptyRow, 2).Value = txtincome.Value
Cells(emptyRow, 3).Value = txtexpenses.Value
Cells(emptyRow, 4).Value = txtactualprofit.Value
Cells(emptyRow, 5).Value = txtbudgetedprofit.Value
End Sub
Private Sub monthandyear_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
MsgBox "Month & Year"
End Sub
Private Sub sbexpenses_Change()
txtexpenses.Text = sbexpenses.Value
End Sub
Private Sub sbincome_Change()
txtincome.Text = sbincome.Value
End Sub
Private Sub txtexpenses_Change()
Dim NewVal As Double
NewVal = val(txtexpenses.Text)
If NewVal >= sbexpenses.min And _
NewVal <= sbexpenses.max Then sbexpenses.Value = NewVal
End Sub
Private Sub txtincome_Change()
Dim NewVal As Double
NewVal = val(txtincome.Text)
If NewVal >= sbincome.min And _
NewVal <= sbincome.max Then sbincome.Value = NewVal
End Sub
Private Sub UserForm_Initialize()
'Empty Income Text Box and Set the Cursor
txtincome.Value = ""
txtincome.SetFocus
'Empty all other text box fields
txtexpenses.Value = ""
txtactualprofit.Value = ""
txtbudgetedprofit.Value = ""
'Clear All Month and Year Related Fields
cmbmonth.Clear
cmbyear.Clear
'Fill Month Drop Down box - Takes Jan to Dec
With cmbmonth
.AddItem "JAN"
.AddItem "FEB"
.AddItem "MAR"
.AddItem "APR"
.AddItem "MAY"
.AddItem "JUN"
.AddItem "JUL"
.AddItem "AUG"
.AddItem "SEP"
.AddItem "OCT"
.AddItem "NOV"
.AddItem "DEC"
End With
'Fill Year Drop Down box - Takes 2010 to 2018
With cmbyear
.AddItem "2010"
.AddItem "2011"
.AddItem "2012"
.AddItem "2013"
.AddItem "2014"
.AddItem "2015"
.AddItem "2016"
.AddItem "2017"
.AddItem "2018"
End With
End Sub