View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
staying[_4_] staying[_4_] is offline
external usenet poster
 
Posts: 1
Default Inputbox error? 10 divided by 100 equals 0.100000001490116 ???


Hey, guys.

I was setting up an inputbox for percentile value input, and the
weirdest thing happened. The code follows.

====================
Option Explicit

Sub inputboxtest()

Dim aa As Single

aa = Application.InputBox(Prompt:="Type in 10 for 10 percent", Type:=1)
/ 100
MsgBox aa
ActiveSheet.Range("a1").Value = aa

End Sub
====================

Why is this happening? Msgbox shows 0.1 but the value in the cell A1 is
not the same value.

What am I missing?

Thanks.


--
staying
------------------------------------------------------------------------
staying's Profile: http://www.excelforum.com/member.php...o&userid=23230
View this thread: http://www.excelforum.com/showthread...hreadid=385805