Solved

Excel Number Formatting

Posted on 2007-03-30
2
1,138 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now