If Statement Query

AdrianL

New Member
Joined
Apr 2, 2019
Messages
3
Hi All,

I have the following in a worksheet

"=IF(F2>=801;3;2)"

It worked perfectly if the value in cell "F2" was populated from another cell on a different worksheet, within the same workbook.
When the value in cell "F2" is populated from a text box on a user form it no longer works.
Why would that be and is there a remedy.

I would appreciate your help...

Thanks

A
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I suspect that the value is text not numerical.
What code are you using to populate the cell?
 
Upvote 0
The cell "F2" is populated directly from the textbox contents.

If ComboBox1 = "Floor Units" Then
Sheets("Floor Unit").Range("f2") = TextBox1
Sheets("Floor Unit").Range("d2") = TextBox2
Sheets("Floor Unit").Range("e4") = TextBox3
End If
 
Upvote 0
In that case try
Code:
Sheets("Floor Unit").Range("f2") = val(TextBox1)
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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