Inputbox error? 10 divided by 100 equals 0.100000001490116 ???

  • Thread starter Thread starter staying
  • Start date Start date
S

staying

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top