View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Shane Devenshire[_2_] Shane Devenshire[_2_] is offline
external usenet poster
 
Posts: 3,346
Default Adjusting formulas by copying across cells w/o changing the re

Hi,

Here is a shorter version of Bassman's post

Sub addround()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula And IsNumeric(cell) Then
cell = "=ROUND(" & Mid(cell.Formula, 2, 1000) & ",2)"
End If
Next cell
End Sub

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Jamie" wrote:

That didn't work. Maybe because the actual cells are different? the actual
cells are C30:G30 instead of the A1:A3 like I posted before.

Jamie

"Sean Timmons" wrote:

In a blank cell, type:

=ROUND(INDIRECT("A1"),-2)

and paste across.

"Jamie" wrote:

Hello,

I was wondering if the below situation could be made easier:

I have cells that already have a formula in them. The formulas have no
specific pattern. Therefore I can't just adjust one formula and copy that
across because the referenced cells will change. I need to adjust that
formula for all the cells but the reference need to stay the same.

For example: cell A1: =g25*f2 A2: = z1*aa5 A3: =b2/b3

I need to round the answers so I want the cell formulas to look like this:
A1:=round(g25*f2,-2) A2: =round(z1*aa5,-2) etc...

Is there anyway to add the "round" formula, or any formula for that matter,
to one cell and then copy it to the remaining cells so that just the "round"
formula is added and all the references stay exactly the same.

Thanks,