Brandon Brandon - 6 days ago 6
Vb.net Question

Adjusting number format using vb.net

I have this statement nested in an IF-Statement under a scenario. I would like it to format column 2 into a Accounting number without decimal places. How can this be done using VB.net? The current code gives me ex:

1,000,000.00
on an input of
1000000
. I noticed excel has buttons for adding or subtracting decimal places. Could these be called within VB.net? Thanks!

Lo.ListColumns("Column2").DataBodyRange(CurrentRow).NumberFormat = "ACCOUNTING"

Answer

Try the following

Lo.ListColumns("Column2").DataBodyRange(CurrentRow).NumberFormat = "#0,000.00"

You may find help in this Article

Comments