Excel Format Cells Numeric Currency VBA

  • Thread starter Thread starter samadams_2006
  • Start date Start date
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.
 
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
 
Back
Top