I am trying to round any percentage in the table up or down to the nearest whole number. For example, 2.56% to 3% and 2.42% to 2%.
I found the following macro (originally meant to change percentages to decimals). It takes the number from 2.56% to 2.56. I changed the "2" to "0" and get 3.00. But when I try to change the number format to get 3% I have trouble. Is there a way to fix it or is there another macro I should try?
Public Sub PercentsToDecimal()
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange.Cells
With rCell
If .NumberFormat Like "*%*" Then
.Value = Application.Round(.Value * 100, 2)
.NumberFormat = "0.00"
End If
End With
Next rCell
End Sub
Thanks for any help.
Bookmarks