View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben[_2_] Gord Dibben[_2_] is offline
external usenet poster
 
Posts: 621
Default adding a forumla to cells with formula in them already

Select the 2500 cells then run this macro.

Sub RoundAdd()
Dim mystr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=ROUND(*" Then
mystr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=ROUND(" & mystr & ",0)"
End If
End If
Next
End Sub

Gord



On Fri, 3 May 2013 13:06:36 +0100, iVassh
wrote:


I need to add a round command to about 2500 cells and many of them have
their own individual formula is there any way to add round to all of
them?

I tried selecting them all and using ctrl+enter but that changed all the
formulas to the same so that didn't work

what I want to end up with is this

=round("whats already in this cell",0)