Option Explicit
Private Sub UserForm_Initialize()
ComboBox1.RowSource = ""
ComboBox1.List = WorksheetFunction.Transpose([REF])
End Sub
Private Sub ComboBox1_Change()
AfficheRésu
End Sub
Private Sub ComboBox2_Change()
AfficheRésu
End Sub
Private Sub AfficheRésu()
If ComboBox1.MatchFound And ComboBox2.MatchFound Then
TextBox1.Text = Format([PRIX].Item(ComboBox2.ListIndex + 1, ComboBox1.ListIndex + 1).Value, "0.00 €")
Else
Me.TextBox1.Text = ""
End If
End Sub
Option Explicit
Private Sub UserForm_Initialize()
CBxCode.List = [CODE].Value
CBxRef.List = WorksheetFunction.Transpose([REF])
End Sub
Private Sub CBxRef_Change()
AfficheRésu
End Sub
Private Sub CBxCode_Change()
AfficheRésu
End Sub
Private Sub AfficheRésu()
If CBxRef.MatchFound And CBxCode.MatchFound Then
TextBox1.Text = Format([PRIX].Item(CBxCode.ListIndex + 1, CBxRef.ListIndex + 1).Value, "0.00 €")
Else
Me.TextBox1.Text = ""
End If
End Sub
Option Explicit
Private RngPrix As Range
Private Sub UserForm_Initialize()
Set RngPrix = [prix_]
ComboBox1.RowSource = ""
ComboBox2.RowSource = ""
ComboBox1.List = WorksheetFunction.Transpose(RngPrix.Rows(0))
ComboBox2.List = RngPrix.Columns(0).Value
End Sub
Private Sub ComboBox1_Change()
AfficheRésu
End Sub
Private Sub ComboBox2_Change()
AfficheRésu
End Sub
Private Sub AfficheRésu()
If ComboBox1.MatchFound And ComboBox2.MatchFound Then
TextBox1.Text = Format(RngPrix.Item(ComboBox2.ListIndex + 1, ComboBox1.ListIndex + 1).Value, "0.00 €")
Else
Me.TextBox1.Text = ""
End If
End Sub