Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Pat
 
Posts: n/a
Default Changing Cell References in Formulas

Win XP/Excel 2002

You guys are great!

So, two question: Is there a way to globally replace certain numbers within
a formula.

2nd: Without editing each formula, etc - is there a function that I can
make the formulas cell references absolute?

Thanks!

Pat Joram



  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
1). Why not use 'Edit - Replace'
2) a repost from Gord Dibben:

----------------------------

Only through VBA macro.

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.


--
Regards
Frank Kabel
Frankfurt, Germany
"Pat" schrieb im Newsbeitrag
...
Win XP/Excel 2002

You guys are great!

So, two question: Is there a way to globally replace certain numbers
within
a formula.

2nd: Without editing each formula, etc - is there a function that I can
make the formulas cell references absolute?

Thanks!

Pat Joram





  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

You can do editreplace to replace parts of a formula

To change from relative to absolute you need a macro unless you want to edit
each cell, press Alt+ F11, click insert module and paste in the following

Sub ReltoAbs()
Dim Cell As Range
For Each Cell In Selection
Cell.Formula = Application.ConvertFormula(Cell.Formula, xlA1, xlA1,
xlAbsolute)
Next
End Sub

press alt + Q to close the editor, sabve the workbook, select the range you
want to change, do alt + F8 and run the macro (you can also put it in the
personal.xls to make it available for all workbooks)

Regards,

Peo Sjoblom

"Pat" wrote:

Win XP/Excel 2002

You guys are great!

So, two question: Is there a way to globally replace certain numbers within
a formula.

2nd: Without editing each formula, etc - is there a function that I can
make the formulas cell references absolute?

Thanks!

Pat Joram




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
Cell Formats in formulas C. Lewis Excel Discussion (Misc queries) 1 January 5th 05 06:37 PM
Changing cell references Tracey Excel Discussion (Misc queries) 4 January 4th 05 08:05 PM
Excel: how to formulate conditional cell references centraloffice Excel Worksheet Functions 1 December 10th 04 08:57 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 27th 04 11:31 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 07:52 AM.

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"