Solved

Excel Number Formatting

Posted on 2007-03-30
2
1,145 Views
Last Modified: 2011-09-20
I am formatting data in an excel worksheet that will eventually be exported into a database.  I have a column of numbers that are for example 0.002563589623.  I need to shorten those to 0.0026.  When I use the format number option, it appears to be correct but in the formula bar it appears as original.  Is there a simple way to shorten the number completely without retyping the entire 14,000 cells?
0
Comment
Question by:mikemomyer
2 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 125 total points
ID: 18824805
I would not recommend doing that but, if you really want, here is macro that will round the selected cells:

Public Sub RoundNumbers()

   Dim Cell As Range
   
   For Each Cell In Selection
      Cell = Round(Cell, 4)
   Next Cell

End Sub

Kevin
0
 
LVL 5

Expert Comment

by:Michael V Bernot
ID: 18830692
Hello mikemomyer,
      There is also a way to change the numbers to the way they are displayed:

Tools---Options---Calculation-----
Under Workbook Options
Check the box ---->Precision as Displayed.

 You will get a warning, but the numbers will be shown as you have them displayed.  Good Luck.

MVB



0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question