adding a forumla to cells with formula in them already
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) |
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) |
All times are GMT +1. The time now is 02:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com