Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default formatting a variable

Is there anyway to formatt a variable?

so instead of seeing:
x = 10000

the variable ='s
x = 10,000

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default formatting a variable

Use the Format() function

Format(varName,"$#,##0.00") or Format(varName,"#,##0.00")

The # symbol in the mask meansif there's a value at this position,
display/print it, otherwise leave blank, while the 0 in the format mask means
if there is no value at this position, place as 0.


--
Kevin Backmann


"dstiefe" wrote:

Is there anyway to formatt a variable?

so instead of seeing:
x = 10000

the variable ='s
x = 10,000

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default formatting a variable

I'm getting a compile error when I use the ( )?

"Kevin B" wrote:

Use the Format() function

Format(varName,"$#,##0.00") or Format(varName,"#,##0.00")

The # symbol in the mask meansif there's a value at this position,
display/print it, otherwise leave blank, while the 0 in the format mask means
if there is no value at this position, place as 0.


--
Kevin Backmann


"dstiefe" wrote:

Is there anyway to formatt a variable?

so instead of seeing:
x = 10000

the variable ='s
x = 10,000

Thank you

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default formatting a variable

The parenthesis are needed when there is a condition involved. i.e. x =
format(x,"$#,##0.00").
--
JNW


"dstiefe" wrote:

I'm getting a compile error when I use the ( )?

"Kevin B" wrote:

Use the Format() function

Format(varName,"$#,##0.00") or Format(varName,"#,##0.00")

The # symbol in the mask meansif there's a value at this position,
display/print it, otherwise leave blank, while the 0 in the format mask means
if there is no value at this position, place as 0.


--
Kevin Backmann


"dstiefe" wrote:

Is there anyway to formatt a variable?

so instead of seeing:
x = 10000

the variable ='s
x = 10,000

Thank you

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 a two-variable data table via sarpi Excel Worksheet Functions 0 June 16th 11 04:05 PM
Conditional Formatting using variable text murkaboris Excel Discussion (Misc queries) 4 August 31st 09 03:07 AM
Set formatting variable Sige Excel Programming 4 September 29th 05 11:41 PM
Stuffing Numeric Variable Values into Footnote with formatting Dkline[_3_] Excel Programming 2 August 15th 05 09:44 PM
Formatting a Variable Arturo Excel Programming 1 October 18th 04 10:38 PM


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

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

About Us

"It's about Microsoft Excel"