Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel Number Formatting

Posted on 2007-03-30
2
Medium Priority
?
1,154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

688 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