A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to make a column of formulas all ROUND



 
 
Thread Tools Display Modes
  #1  
Old May 13th, 2010, 11:41 PM posted to microsoft.public.excel.misc
Cobaum
external usenet poster
 
Posts: 19
Default How to make a column of formulas all ROUND

I created a spreadsheet in which I have a column of formulas. Most of these
fomulas are simply pulling a single number off another sheet. I want to make
all the formulas ROUND versions of the existing formula without having to go
into each cell and making the change. They are not in order to which I can
just make the first fomula a ROUND fomula and copy down. So, is there a way
to select a range of cells and make the existing fomulas all ROUND versions?
Thanks.
  #2  
Old May 14th, 2010, 12:47 AM posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
 
Posts: 20,252
Default How to make a column of formulas all ROUND

Would this help?

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

If not post back with what you have in the "not in order" cells.


Gord Dibben MS Excel MVP

On Thu, 13 May 2010 15:41:01 -0700, Cobaum
wrote:

I created a spreadsheet in which I have a column of formulas. Most of these
fomulas are simply pulling a single number off another sheet. I want to make
all the formulas ROUND versions of the existing formula without having to go
into each cell and making the change. They are not in order to which I can
just make the first fomula a ROUND fomula and copy down. So, is there a way
to select a range of cells and make the existing fomulas all ROUND versions?
Thanks.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:53 AM.


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