LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Adding a single function onto multiple cells that already have

Happy to hear that.

Thanks for the feedback.



On Tue, 23 Jan 2007 11:50:01 -0800, J@Y wrote:

Great thanks, works like a charm.

"Gord Dibben" wrote:

JY

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 & "," & "2" & ")"
End If
End If
Next
End Sub

Change the "2" to whatever suits you before running the macro.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP



On Mon, 22 Jan 2007 13:29:02 -0800, J@Y wrote:

If I have a column of numbers, and I want to put =round() function on all of
them, is there a way to do it so that I am not creating another column with
reference to the existing column of numbers?




 
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
List of functions contained in the add-ins, esp. Analysis Toolpak Neil Goldwasser Excel Worksheet Functions 3 January 12th 07 12:43 PM
adding multiple cells together ignitedaz Excel Discussion (Misc queries) 3 September 8th 06 09:26 PM
Adding up multiple cells Andy Excel Worksheet Functions 2 July 11th 06 04:57 PM
IF function....testing against values in multiple cells racmb1975 Excel Worksheet Functions 2 October 12th 05 07:50 PM
Adding an accumulator for multiple cells jrambo63 Excel Worksheet Functions 3 May 26th 05 05:50 PM


All times are GMT +1. The time now is 11:29 PM.

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

About Us

"It's about Microsoft Excel"