views:

20

answers:

1

Does anyone have any vb.net or vba code that will format excel values or a range of cells to have comma for 100s, 1000s,10000s etc.. and 2 decimal places only.

i.e. 10,256.45

+1  A: 

With a reference to the range:

rng.NumberFormat = "#,##0.00"

The current selection is also a range, so if you want it to work with the selection, just use:

Selection.NumberFormat = "#,##0.00"
Jay