View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
J.E. McGimpsey J.E. McGimpsey is offline
external usenet poster
 
Posts: 493
Default @ Round Formulas

One way:

Select the range of cells you want to convert. The range can include
Text, constants, etc - only the formulae will be converted. Change
the "0" in the cell.Formula line to the number of places you want to
round to.

Public Sub WrapARound()
Dim cell As Range
On Error Resume Next
For Each cell In Selection.SpecialCells(xlCellTypeFormulas)
cell.Formula = "=ROUND(" & Mid(cell.Formula, 2) & ",0)"
Next cell
On Error GoTo 0
End Sub


In article ,
"John M" wrote:

Hello,

I have numerous formulas that I need to convert to
@round. Does anyone know of a fast way to do that? I
tried an "edit/replace" technique but that did not work
since all the formulas are different. Any advice would be
much appreciated.

John