Excel Format Cells Numeric Currency VBA

S

samadams_2006

Hello,

I came across some VBA Code that formats an Excel cell, and I was
wondering if anyone can explain to me what the various symbols mean:

1) _([$£-809]#,000.0_); ([$£-809]#,000.0)

2) #,##0.0[$p]_);(#,000.0[$p]);#,000.0[$p]_); @_)

3) _([$$-409]#,000.0_); ([$$-409]#,000.0)

4) [$P-1404]#,#00.0

In particular, the [$£-809] , [$p] , [$$-409] , [$P-1404]

Are there any good Web Sites that explain all this formatting?

Thanks.
 
L

Leung

These are the number format and you can check then in the cell format dialog
box by select the cell then choose customer format and you place the string
there.

e.g. you type 45656 in the cell
then format it using your first string of "_([$£-809]#,000.0_);
([$£-809]#,000.0)" then the result is £45,656.0

in VBA, you format the cell by setting its NumberFormat property and for
detail of this format, you could search "Create or delete a custom number
format" in the excel help (not VBA).

Hope this help.




e.g

Sub SetFormatOnSelectedCell()
Selection.NumberFormat = "_(* #,##0_);_(* (#,##0);_(* ""-""_);_(@_)"
end sub
 

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