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
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

iggydarsa

Well-known Member
Joined
Jun 28, 2005
Messages
1,647
MsgBox ("Currents are: " & Format(current(1), "0.00E+00"))
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
Is the data from a worksheet cell and formatted as required there?

If so use the Text property.
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
If you want to display a negative exponent I think you need something like

Code:
MsgBox Format(myval, "0.0E-0")
 

marino72

Board Regular
Joined
May 28, 2008
Messages
74

ADVERTISEMENT

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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
Hard to tell really without seeing the rest of the code.

Specifically how you are populating what appears to be an array, current, somewhere.
 

marino72

Board Regular
Joined
May 28, 2008
Messages
74
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,569
Messages
5,596,912
Members
414,110
Latest member
docops

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
Top