Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Formatting a MsgBox number

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Formatting a MsgBox number

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)

"Otto Moehrbach" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formatting a MsgBox number

msgbox FoundCell.Text

is another way.

--
Regards,
Tom Ogilvy


Otto Moehrbach wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Formatting a MsgBox number

Bob, Tom
What can I say? Thanks again. Otto
"Tom Ogilvy" wrote in message
...
msgbox FoundCell.Text

is another way.

--
Regards,
Tom Ogilvy


Otto Moehrbach wrote in message
...
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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting number Connie Martin Excel Discussion (Misc queries) 7 August 10th 08 10:28 PM
Number Formatting vrc44 Excel Discussion (Misc queries) 1 January 3rd 08 04:41 PM
number formatting help [email protected] Excel Discussion (Misc queries) 8 February 12th 07 10:59 PM
formatting cell number based on previous cell number Pasquini Excel Discussion (Misc queries) 3 June 20th 06 06:36 AM
Formatting number in VBA John Pierce Excel Programming 2 November 21st 03 04:02 PM


All times are GMT +1. The time now is 06:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"