Hello everyone.
Can somebody please help understand what's going wrong with the line of code that's suppose to format the combobox to show only 3 decimal places? It is as if that line of code does not exist at all, since the result of having it or not it's the same.
The userform code follows below:
Thank you for your help.
Can somebody please help understand what's going wrong with the line of code that's suppose to format the combobox to show only 3 decimal places? It is as if that line of code does not exist at all, since the result of having it or not it's the same.
The userform code follows below:
Code:
Private Sub UserForm_Activate()
With UserForm1
.Top = Application.Top + 15 '< change 125 to what u want
.Left = Application.Left + 600 '< change 25 to what u want
End With
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
End If
End Sub
Private Sub UserForm_Initialize()
'Load both combobox w/ cell values
Me.ComboBoxPrice.List = Worksheets("temp filter").Range(Cells(2, 10), Cells(2, 10).End(xlDown)).Value
Me.ComboBoxPrice.Value = Format(Me.ComboBoxPrice.Value, "#.000")
Me.ComboBoxSupplier.List = Worksheets("temp filter").Range(Cells(2, 12), Cells(2, 12).End(xlDown)).Value
End Sub
Private Sub comboboxPrice_change()
'Select sheet
If ActiveSheet.Name = "temp filter" Then
ActiveSheet.Previous.Activate
End If
'Force CB2 value = CB1 list index #
ComboBoxSupplier.ListIndex = ComboBoxPrice.ListIndex
End Sub
Private Sub comboboxSupplier_change()
'Select sheet
If ActiveSheet.Name = "temp filter" Then
ActiveSheet.Previous.Activate
End If
'Force CB1 value = CB2 list index #
ComboBoxPrice.ListIndex = ComboBoxSupplier.ListIndex
End Sub
Private Sub commandbuttonOK_click()
ActiveCell.Value = ComboBoxPrice.Value
Cells(ActiveCell.Row, ActiveCell.Column + 1).Value = ComboBoxSupplier.Value
Unload Me
End Sub
Private Sub commandbuttonCancel_click()
Unload Me
If ActiveSheet.Name = "temp filter" Then
ActiveSheet.Previous.Activate
End If
End Sub
Thank you for your help.