Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Why not format as General?
-- David Biddulph "santhagr" wrote in message oups.com... i don't know how to make a format in order to place the dot and the digits that follow if there are any and if there aren't NOT to have a dot standing there alone. so far i put the special format: ### ### ###.## but there is a dot alone and if i put : ### ### ###_0_0 it rounds the number up do u have any idea?? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i don't know how to make a format in order to place the dot and the
digits that follow if there are any and if there aren't NOT to have a dot standing there alone. so far i put the special format: ### ### ###.## but there is a dot alone and if i put : ### ### ###_0_0 it rounds the number up do u have any idea?? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i want to have the spaces also: 1 200 400 not 1200400
|
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You won't be able to do this with numberformatting alone.
If the values are typed in (not the results of a formula), you could use an event macro. Rightclick on the worksheet tab that should have this behavior. Select view code and paste this in the code window: Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Cells.Count 1 Then Exit Sub If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then Exit Sub End If If Int(.Value) = .Value Then 'no decimal places .NumberFormat = "### ### ###" 'or maybe '.NumberFormat = "### ### ###_._0_0" Else .NumberFormat = "### ### ###.##" 'or maybe '.NumberFormat = "### ### ###.00" End If End With End Sub Then back to excel to test it out. I adjusted the cells in column A. Change it to what you want. If the values change as the result of a formula recalculation, a different event (with small differences in code) could be used. The 'or maybe versions may be nice if you want the (assumed) decimal places to align. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm You can read more about events at: Chip Pearson's site: http://www.cpearson.com/excel/events.htm David McRitchie's site: http://www.mvps.org/dmcritchie/excel/event.htm santhagr wrote: i don't know how to make a format in order to place the dot and the digits that follow if there are any and if there aren't NOT to have a dot standing there alone. so far i put the special format: ### ### ###.## but there is a dot alone and if i put : ### ### ###_0_0 it rounds the number up do u have any idea?? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
assigning class standing based on grade | Excel Discussion (Misc queries) |