Formatting a MsgBox number

O

Otto Moehrbach

Excel 2003, WinXP
Programming:
I have a cell variable FoundCell.
The value of FoundCell is 1.2. It can be any numerical value.
FoundCell is formatted as Currency, dollar sign 2 places, so the cell
appears as $1.20.
I want to put this value into a MsgBox and have it appear as $1.20
IOW, I want MsgBox FoundCell.Value to produce $1.20

I tried using Len(Application.WorksheetFunction.Mod..........) to determine
the length of the remainder so I could append zeros as needed but I don't
thing the worksheet Mod function will work in this manner.

I tried Application.WorksheetFunction.Text.... and that didn't work.
Is there a way to do this? Thanks for your help. Otto
 
B

Bob Phillips

Hi again Otto,

Try

MsgBox Format(FoundCell.Value,"$#,##0.00")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Top