Oliver Dewar
Board Regular
- Joined
- Apr 17, 2011
- Messages
- 201
OK I've come across one extremely odd case for the X(cel)-files.
This is something I have done over and over in this project except for one difference... this cell has a formula in it, not just a value as in the others.
in the cell in question I have a formula that works well. Here's the formula:
this code works out the age of someone from a number and date of input or the words Child or Adult.
the cell in question (A1) returned 13.
in textbox1 on a userform I have a textbox1_change as follows:
I type in the number 13 into textbox1 and... nothing happens!
Now, I have found a workaround in that I copy the value of the formula to another cell on the sheet and the contents of the textbox to the next cell and compare those... and it works!
So really my question is... what is going on? Why doesn't 13 in textbox1 = 13 (the result of the formula) in cell A1?
Any Moulders out there?
This is something I have done over and over in this project except for one difference... this cell has a formula in it, not just a value as in the others.
in the cell in question I have a formula that works well. Here's the formula:
Code:
=IF($Y39="","",IF($Y39="Child","Child",IF($Y39="Adult","Adult",DATEDIF($Z39,TODAY(),"y")+$Y39)))
the cell in question (A1) returned 13.
in textbox1 on a userform I have a textbox1_change as follows:
Code:
Textbox1_change()
if textbox1.value = range("A1").value then
msgbox"match"
End if
End Sub
I type in the number 13 into textbox1 and... nothing happens!
Now, I have found a workaround in that I copy the value of the formula to another cell on the sheet and the contents of the textbox to the next cell and compare those... and it works!
So really my question is... what is going on? Why doesn't 13 in textbox1 = 13 (the result of the formula) in cell A1?
Any Moulders out there?