Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Mutiply format question 1

Status
Not open for further replies.

Queryman

Programmer
Joined
Nov 4, 2002
Messages
243
Location
US
I have a percentage number that comes in from another program, but the number comes in in this format (90.37). I want to be able to hit the % format key & format this number and all the numbers in this column as percentages. I know I can insert another column and divide this column's numbers by 100 & then hit the % key to format in percentage. But my question is is there a way to do it without doing that, can I divide the numbers in a column by 100?
Thanks

Michael

 
Hi Queryman,

The best I can suggest is that you have the value 0.01 in another cell, which you copy - Edit Copy.

Then highlight the column or cell you want to apply this value to. Now select Edit, Paste Special, Multiply, and then OK. Then hit the % Toolbar button to make them percentages.

Good Luck

Peter Moran
Two heads are always better than one!
 
The following will do it all in one go for you:-

Sub ChangeDec()

Dim Cell As Range
For Each Cell In ActiveSheet.UsedRange
Cell.Value = Cell.Value / 100
Cell.Style = "Percent"
Next Cell
End Sub

Regards
Ken.............
 
Or if you just want to apply it to a selected range, you can use the following:-

Sub ChngDecSelec()

Dim Cell As Range
For Each Cell In Selection
Cell.Value = Cell.Value / 100
Cell.Style = "Percent"
Next Cell
End Sub

Regards
Ken...........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top