0

I am having trouble adding a zero after the decimal when coding in excel. The number that is being output is 240 and I want it to say 240.0. I have tried the round function in excel however that is only working when I have something like 242.46 and it gaves me 242.5.

Paul
  • 1
  • 1

2 Answers2

1

Try:

oWrkSheet.Cells(110, 17).NumberFormat = "0.0"

It can work for many other numeric formats. See this post for more informations.

Community
  • 1
  • 1
Fjodr
  • 919
  • 13
  • 32
0

You can use a formula:

=TEXT(A1,"0.0")

Either change A1 to the appropriate cell, or surround the cell in question with a =TEXT(...,"0.0")

chancea
  • 5,858
  • 3
  • 29
  • 39