Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Adding a single function onto multiple cells that already have Num

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Adding a single function onto multiple cells that already have Num

=ROUND(A1:A10,1) entered with CTRL+SHIFT+ENTER, but this applies only a
single value in a single cell. Not sure that's what you want.
--
Brevity is the soul of wit.


"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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Adding a single function onto multiple cells that already have

Thanks for the reply. That way you have there requires me to create another
column to input the =round() function. I want to have the =Round() function
added to existing numbers or equations in a specific column. For example: if
I have equations or numbers in column A1:A3 =

Colummn A
= 2*1.5
= 3.5*2.5
= 2.2*3.5

I want it so that it will become:

Colummn A
= round(2*1.5,1)
= round(3.5*2.5,1)
= round(2.2*3.5,1)

without having to go through everyline and adding it through.



"Dave F" wrote:

=ROUND(A1:A10,1) entered with CTRL+SHIFT+ENTER, but this applies only a
single value in a single cell. Not sure that's what you want.
--
Brevity is the soul of wit.


"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?

  #4   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 Num

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?


  #5   Report Post  
Posted to microsoft.public.excel.misc
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Adding a single function onto multiple cells that already have

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?





  #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?




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
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 10:03 AM.

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"