View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1990_] Rick Rothstein \(MVP - VB\)[_1990_] is offline
external usenet poster
 
Posts: 1
Default accept fractions from textbox

The Val function will not convert fractions to floating point values; it
will print the numerator only.

Rick


"Mike H" wrote in message
...
Hi,

Textboxes (unsurprisingly) return text so you need val

mynumber = Val(UserForm1.TextBox2.Value)

Mike

"brianbanksia" wrote:

I cannot enter fractions in a TextBox and have them recognised as
numbers.

If IsNumeric(UserForm1.TextBox2.Value) = False Then 'Quantity
MsgBox "Choose NUMERIC quantity. Transaction cancelled!", , "Company
Name"
End If

I am having trouble getting this to work in Excel 2007; Vista whereas
works
Excel 2003 XP.

Is there a better way or is it a machine setting problem rather than
Excel
(eg Universal Date settings etc)
Thanks B