Avatar of Software Engineer
Software Engineer
 asked on

Excel: Decimal Placement Appearance

Hello:

I need for the numbers in each column of the attached Excel spreadsheet to "be" just as they appear.  

For example, in cell A2510, I need for the number to be just as it appears.  It needs to be 15440.92243.  It should not be 15440.9224333333, as Excel is showing it as at the top of the application.

What do I need to do, in order to make this happen?

Thank you!

John

Experts-Exchange-Decimal-Format.xlsx
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Software Engineer

8/22/2022 - Mon
Martin Liss

You would need to do something like this for each cell.

range("A2510") = range("A2510").Text
Martin Liss

Here's a macro that will do that.
Sub AlterValue()
Dim cel As Range

Application.ScreenUpdating = False
Application.EnableEvents = False

For Each cel In ActiveSheet.UsedRange.Cells
    cel = cel.Text
Next

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

Open in new window

Software Engineer

ASKER
I get an error with the use of that formula.  Can you please show me how to place it in Excel?

I'd prefer not to use a macro.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Software Engineer

ASKER
Also. I just now tried to make the cells to be text.  The results were not what I wanted.  Doing so added extra decimal placement.

John
ASKER CERTIFIED SOLUTION
Software Engineer

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rob Henson

There is an option in Excel that will force calculations to use the precision as displayed.

So use the normal formatting tools to get the number of decimal places required and then use Excel options to set this option:
Precision setting
Software Engineer

ASKER
My colleague gave me the correct response.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.