#1   Report Post  
andrewm
 
Posts: n/a
Default replace function


Hi I have numerous formulas with relative cells in them eg. a5, c6,
etc
I would like to change then to absolute values ($a$5, $c$6, etc)with
the edit, replace .....

can anyone help

thanks


andrew


--
andrewm
------------------------------------------------------------------------
andrewm's Profile: http://www.excelforum.com/member.php...o&userid=23130
View this thread: http://www.excelforum.com/showthread...hreadid=388266

  #2   Report Post  
Gordon
 
Posts: n/a
Default

"andrewm" wrote in
message ...

Hi I have numerous formulas with relative cells in them eg. a5, c6,
etc
I would like to change then to absolute values ($a$5, $c$6, etc)with
the edit, replace .....


Find - a - Replace with - $a$ - replace all.

Now that's not very hard, is it?


  #3   Report Post  
Niek Otten
 
Posts: n/a
Default

Be aware that Excel will change ALL a's into $a$, including those in text
and in addresses like AA12

Here is what Gord Dibben answered some time ago

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
================================================== ==========


Sharon


You would need VBA to make global changes to cell references.


Here are four........


Sub Absolute()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsolute)
End If
Next
End Sub


Sub AbsoluteRow()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsRowRelColumn)
End If
Next
End Sub


Sub AbsoluteCol()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelRowAbsColumn)
End If
Next
End Sub


Sub Relative()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelative)
End If
Next
End Sub


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..........


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 above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Run the macro by going to ToolMacroMacros.


Gord Dibben Excel MVP


On Mon, 18 Apr 2005 15:36:09 -0700,

"Gordon" wrote in message
...
"andrewm" wrote in
message ...

Hi I have numerous formulas with relative cells in them eg. a5, c6,
etc
I would like to change then to absolute values ($a$5, $c$6, etc)with
the edit, replace .....


Find - a - Replace with - $a$ - replace all.

Now that's not very hard, is it?




  #4   Report Post  
Gordon
 
Posts: n/a
Default


"Niek Otten" wrote in message
...
Be aware that Excel will change ALL a's into $a$, including those in text
and in addresses like AA12


Depends - if all the references are in one column, just select the column.


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
slow replace function hiwan99 Excel Worksheet Functions 3 July 6th 05 11:49 PM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 07:32 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"