Brad
Brad

Reputation: 1480

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"

Upvotes: 0

Views: 496

Answers (2)

Anon Emouse
Anon Emouse

Reputation: 74

From what i understand you want, you can do:

math.floor(*insert the value or variable you want here*)

What that does is it changes the number in the parameter to the biggest integer lower than the parameter.

Hope this works :)

Upvotes: 1

Hadi
Hadi

Reputation: 37313

Try the following

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

You may find help in this Article

Upvotes: 1

Related Questions