View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JulieD JulieD is offline
external usenet poster
 
Posts: 618
Default Entry of data in formula bar ignores cell percentage formatting

Hi Larry

bit confused here, if he formatted the cell using the % on the toolbar then
the number will be multiplied by 100 and the % sign added when he enters a
number - whether entered through the formula bar or directly into the cell -
(i wrote a post about a week ago complaining about this:). This also
happens when you format the cell using format cells / number / percentage
(and if you have a look on this screen when you choose percentage it clearly
states that "percentage format multiplies the cell value by 100 and displays
the result with a percent symbol". )

so alternatives
1) divide the number by 100 when he enters it
2) type a % after the number and leave the cell format as general.
3) if he has lots of these to do he could choose tools / options / edit -
check fixed decimal places, set it to 2 then enter his "normal" numbers into
% formatted cells and then uncheck this when he's finished.
4) Gord Dibben posted this code the other day (in response to my complaining
:) - thanks Gord)
Sub NumToPercent()
Dim c As Range
For Each c In Selection
a = c.Value
If IsNumeric(a) Then
If a < 0 Then a = a / 100
c.Value = a
c.Style = "Percent"
End If
Next
End Sub

this code can be added to personal.xls (in a module - post back if you need
details on how to do this), then create a toolbar icon to use to activate
the code & remove the built-in % one.

Hope this helps
Cheers
JulieD



"L Mehl" wrote in message
...
Hello --

My user was complaining that entering a percentage in a
percentage-formatted
cell was resulting in 100 times the value he entered.

His method of entry was to enter the value in the formula bar while the
target cell was hilighted (does not seem like an efficient way to enter
data) which appears to ignore the cell format: Number Percentage.

But ... the customer is always right.

Is there a way to have the cell formatting apply when cell data entry is
via
the formula bar?

Thanks for any help.

Larry Mehl