Scientific Format in Message Box

marino72

Board Regular
Joined
May 28, 2008
Messages
74
Hello folks,
Does anyone know how to display the numbers appearing in message box in scientific format like this (0E 0.00)? The following is a message box that displays current values and I just want the current to look like
2.0E-6 instead of 0.000002

MsgBox ("Currents are: " & current(1))

Thanks folks

M
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
MsgBox ("Currents are: " & Format(current(1), "0.00E+00"))
 
Upvote 0
Is the data from a worksheet cell and formatted as required there?

If so use the Text property.
 
Upvote 0
If you want to display a negative exponent I think you need something like

Code:
MsgBox Format(myval, "0.0E-0")
 
Upvote 0
Thank you Iggydarsa,

It worked great. The "0.00E+00" format worked also well for negative exponent.

Norie, The data is actually from a worksheet cell and it is formated as required. What is the text property and how can I make use of it in a message box.

Thank you all for your input.

M
 
Upvote 0
Hard to tell really without seeing the rest of the code.

Specifically how you are populating what appears to be an array, current, somewhere.
 
Upvote 0
Thanks anyway Norie,
I'm sure time will come when I will need to use this property, I'm just not there yet as I'm still learning my ABCs in VBA

Thanks again

M
 
Upvote 0

Forum statistics

Threads
1,213,513
Messages
6,114,072
Members
448,546
Latest member
KH Consulting

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