Msgbox format

buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
I have a userform that inputs numbers into a spreadsheet, calculates on the spreadsheet and then returns a value in a msgbox. Can I format the result in the message box to only show 3 decimals) "0.000"


Code:
Dim Raws1 As Range, Raws2 As Range, Raws3 As Range
Dim Raws4 As Range, Raws5 As Range, Raws6 As Range
Dim RawMass As Range, MassBal As Variant

Set Raws1 = Sheets("Mass Balance").Range("Raws1")
Set Raws2 = Sheets("Mass Balance").Range("Raws2")
Set Raws3 = Sheets("Mass Balance").Range("Raws3")
Set Raws4 = Sheets("Mass Balance").Range("Raws4")
Set Raws5 = Sheets("Mass Balance").Range("Raws5")
Set Raws6 = Sheets("Mass Balance").Range("Raws6")
Set RawMass = Sheets("Mass Balance").Range("FTIR")

Raws1 = TextBox1.Value
Raws2 = TextBox2.Value
Raws3 = TextBox3.Value
Raws4 = TextBox4.Value
Raws5 = TextBox5.Value
Raws6 = TextBox6.Value
RawMass = TextBox7.Value

Set MassBal = Sheets("Mass Balance").Range("MassBal")

MsgBox ("Mass Balance = " & MassBal)
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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