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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
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,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

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