Need to eliminate scientific display of decimal point

Bill_Biggs

Well-known Member
Joined
Feb 6, 2007
Messages
1,216
I have written a simple macro for a carpenter that converts fractions of a foot (1 ich, 3 inches and so on) to decimal points. Here it is:

Sub Macro1()
Dim A As String
A = InputBox("Enter length you need converted.")
A = A * (1 / 12)
MsgBox A
End Sub

But if I enter 1, the Msgbox displays 8.3333 -2. I would like it to display .083. Can anyone tell me how that is done?

Thanks, as always.

Bill Biggs
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Bill

Just format the result:

Code:
Msgbox Format(A,"0.0000")

Oh, and Dim A as Double too.

Code:
Sub Macro1()
Dim A As Double
A = Application.InputBox("Enter length you need converted.",Type:=1)
A = A * (1 / 12)
MsgBox Format(A,"0.0000")
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,462
Members
449,085
Latest member
ExcelError

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