Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default 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)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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)

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
Adding an aditional forumla to this one Mark D[_2_] Excel Worksheet Functions 4 April 1st 10 04:57 PM
Is there an Excel forumla to count different coloured cells? dataprincess Excel Discussion (Misc queries) 2 November 22nd 07 11:29 PM
Forumla works in all cells but 1 Joe Gieder Excel Worksheet Functions 2 July 12th 07 01:48 PM
adding row to forumla carrera Excel Discussion (Misc queries) 9 August 23rd 05 10:24 PM
How to apply colouring as in Cells associated with Forumla news.microsoft.com[_8_] Excel Programming 7 July 31st 05 05:42 AM


All times are GMT +1. The time now is 01:00 PM.

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

About Us

"It's about Microsoft Excel"