True/False not workin correctly

obiwann

Board Regular
Joined
Jan 2, 2014
Messages
142
I am having a problem with a combobox on a worksheet when I select the number 0.10 and it is reflected in cell A1. Cell A3 should show TRUE because cell B1 is greater than A1. What am I doing wrong? I have cell A1 formatted as a number with 2 decimal places and use of the following code :

Code:
Private Sub Workbook_Open()
With Worksheets("Sheet1").OLEObjects("ComboBox1").Object
.Clear
.AddItem "0.10"
.AddItem "0.20"
.AddItem "0.50"
.ListIndex = 0 'optional
End With
End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
That code has nothing to do with greater than/less than/true/false.

What formula are you using to determine your True/False in A3?

Also, it could be **shrug** that entering data into cells via a combobox doesn't trigger a calculation so maybe using a line of code such as:

Application.Calculate

wherever relevant might do the trick.
 
Last edited:
Upvote 0
A combobox contains text values not numbers, and in Excel =9999>"0.10", for example, will return FALSE.

Try formatting A1 as numeric, removing it as the linked cell and using:

Code:
Private Sub ComboBox1_Change()

    Range("A1").Value = ComboBox1.Value

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top