Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Format of a Variable

Hi everyone, need help again [:'(] :

I have a simple table with two expressions, PROFIT and RESULT. Both are define by two variables (vPROFIT and vRESULT). This two variables are calculated using a macro in VBSCRIPT. When any selection is made in the sheet, the macro runs and this two variables and consequently the two expressions. The problem is that I can't set the format of currency to none of this expressions. See how it shows:

error loading image

Is there any way to set the format of a variable?

Thanks in adavance

1 Solution

Accepted Solutions
Not applicable
Author

It depends on what you have as your variable, but I use something very simple like:

=NUM( $(variablename) , "#,##0.00" )

You do have to be careful about how you define your variable though, because that has an impact on how you can implement it in an expression. For example, the variable cannot start with an equal sign in the above case.

Regards,

View solution in original post

4 Replies
Not applicable
Author

It depends on what you have as your variable, but I use something very simple like:

=NUM( $(variablename) , "#,##0.00" )

You do have to be careful about how you define your variable though, because that has an impact on how you can implement it in an expression. For example, the variable cannot start with an equal sign in the above case.

Regards,

Anonymous
Not applicable
Author

The "traditional" way is to define format in Number tab in the chart properties.

Not applicable
Author

Michael is correct about that, and if you only want one format then that's the easiest place to do it, I use the NUM function because I provide the end-users with the option at run time to swap formats, decimal places, and I also have the issue where I'm dealing in multiple currencies, the standard Number Tab doesn't allow me enough flexibility for this.

Cheers,

Not applicable
Author

Nigel you're right, it works.

Thanks you all!!Smile