Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
fak119
 
Posts: n/a
Default Rounding-Formulas

Is there (or can there be) a macro or a function that changes a formula like

=C1*$R4 in =round(C1*$R4;0) etc.

I have many spreadsheets with hundreds of formulas on each sheet that need
to be rounded. I would have to change individually every single formula. Is
there an easier way?

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Niek Otten
 
Posts: n/a
Default Rounding-Formulas

Depending on how you formatted the cells, you might consider

ToolsOptionsCalculation tab, check Precision as displayed. Look in HELP to read the consequences.

--
Kind regards,

Niek Otten

"fak119" wrote in message ...
| Is there (or can there be) a macro or a function that changes a formula like
|
| =C1*$R4 in =round(C1*$R4;0) etc.
|
| I have many spreadsheets with hundreds of formulas on each sheet that need
| to be rounded. I would have to change individually every single formula. Is
| there an easier way?
|


  #3   Report Post  
Posted to microsoft.public.excel.newusers
JE McGimpsey
 
Posts: n/a
Default Rounding-Formulas

One way:

Public Sub WrapARound()
Const sWRAPPER As String = "=Round(#; 0)"
Dim ws As Worksheet
Dim rFormulae As Range
Dim rCell As Range
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next 'in case no formulae
Set rFormulae = ws.Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0
If Not rFormulae Is Nothing Then
For Each rCell In rFormulae
With rCell
If Not .Formula Like "=ROUND(*" Then _
.Formula = Replace( _
sWRAPPER, "#", Mid(.Formula, 2))
End With
Next rCell
End If
Set rFormulae = Nothing
Next ws
End Sub


In article ,
fak119 wrote:

Is there (or can there be) a macro or a function that changes a formula like

=C1*$R4 in =round(C1*$R4;0) etc.

I have many spreadsheets with hundreds of formulas on each sheet that need
to be rounded. I would have to change individually every single formula. Is
there an easier way?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to minimize rounding error with complicated formulas Erick T. Excel Discussion (Misc queries) 1 January 25th 06 02:05 PM
formulas / rounding JT Excel Worksheet Functions 3 January 19th 06 10:49 PM
Need Formulas for counting multiple conditions OrdOff Excel Worksheet Functions 4 July 3rd 05 06:12 PM
rounding a formula's number [email protected] Excel Worksheet Functions 2 March 9th 05 07:33 PM
Formulas not working John Lovin Excel Worksheet Functions 4 January 24th 05 02:27 AM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"