#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default strange

Put 20 in range B2 and then try this in the immediate window:

ActiveSheet.range("B2").NumberFormat = "$#,##0.00_ ;[Red]-$#,##0.00"

Why does it go to sterling?!!

Regards
Jason.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default strange

On Mon, 22 Jun 2009 08:44:11 -0700 (PDT), WhytheQ
wrote:

Put 20 in range B2 and then try this in the immediate window:

ActiveSheet.range("B2").NumberFormat = "$#,##0.00_ ;[Red]-$#,##0.00"

Why does it go to sterling?!!

Regards
Jason.



I guess the $ character has some special meaning in this context.
It seems it is the way of inserting the currency that is currently set
in the user preferences. And that may be dollars or may not be
dollars.

If you change your command to the following:

ActiveSheet.range("B2").NumberFormat = "\$#,##0.00_ ;[Red]-\$#,##0.00"

i.e. with a \ character just before the $ character (in two places),
the result becomes what you expect.

Hope this helps / Lars-Åke
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
Strange FreedomHillFarm Excel Worksheet Functions 1 January 13th 11 01:12 PM
Need Help: Strange, Strange Behavior ( Not Me. My Model! ) SteveM Excel Programming 2 December 16th 07 06:02 PM
strange... lpi Excel Programming 0 August 24th 07 07:45 PM
Very-2 strange Amiit Mangla Excel Discussion (Misc queries) 4 December 21st 05 12:26 PM
2 strange ones.. RC[_5_] Excel Programming 0 November 17th 04 03:48 PM


All times are GMT +1. The time now is 11:21 AM.

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"