View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default how do I change format to percentage without multiplying by 100

You could use a macro to divide all by 100 before formatting.

Sub NumToPercent()
For Each c In Selection
a = c.Value
If IsNumeric(a) Then
If a < 0 Then a = a / 100
c.Value = a
c.NumberFormat = "0.0%"
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 14 Apr 2010 12:37:02 -0700, Fdn Girl <Fdn Girl
@discussions.microsoft.com wrote:

I have imported ROI data for securities to Excel. However, when the ROI
comes over, it is formatted as 1.3, instead of 1.3%. When I try to change to
format to %, it automatically multiplies by 100 and I get 130%.