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.

4
  • Can you be more specific? What do you mean by coding? With VBA? Can you show us what you tried with code? Commented Apr 27, 2015 at 14:05
  • If it's just in a cell on a worksheet, there is an 'increase decimal' button on the home ribbon (number section) that should do it. Commented Apr 27, 2015 at 14:09
  • ElevImp = Round(ElevVal, 1) Commented Apr 27, 2015 at 14:57
  • that is something I have and I want to be able to make the number be 240.0 instead of 240 Commented Apr 27, 2015 at 14:58

2 Answers 2

1

Try:

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

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

Sign up to request clarification or add additional context in comments.

Comments

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")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.