Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default make formulas from relative to absolute

A coworker has puzzled me with request.

He wants to create formula on Second sheet, then fill formula (to save
retyping), then he wants to convert relative formulas to absolute formulas,
so he can move them around without loosing values.

Is there a code I can run (ex. For Each Cell in Selection) that can convert
formulas to have absolute references

Or may be there is easier way just select and do some command I don't know
about


Your help is appretiated

AvP


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default make formulas from relative to absolute

Look at Application.convertFormula

from the immediate window:

? application.ConvertFormula("=A1:F1",xlA1,xlA1,xlAb solute)
=$A$1:$F$1


--
Regards,
Tom Ogilvy


"Barmaley" wrote in message
...
A coworker has puzzled me with request.

He wants to create formula on Second sheet, then fill formula (to save
retyping), then he wants to convert relative formulas to absolute

formulas,
so he can move them around without loosing values.

Is there a code I can run (ex. For Each Cell in Selection) that can

convert
formulas to have absolute references

Or may be there is easier way just select and do some command I don't know
about


Your help is appretiated

AvP




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default make formulas from relative to absolute

Try something like the following:

Dim R As Range
Dim C As Range
Set C = Application.Intersect( _
ActiveSheet.UsedRange,
Selection).SpecialCells(xlCellTypeFormulas)
For Each R In C
If R.Has = True Then
R.FormulaArray = Application.ConvertFormula(R.Formula,
xlA1, xlA1, True)
Else
R.Formula = Application.ConvertFormula(R.Formula, xlA1,
xlA1, True)
End If
Next R


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Barmaley" wrote in message
...
A coworker has puzzled me with request.

He wants to create formula on Second sheet, then fill formula
(to save
retyping), then he wants to convert relative formulas to
absolute formulas,
so he can move them around without loosing values.

Is there a code I can run (ex. For Each Cell in Selection) that
can convert
formulas to have absolute references

Or may be there is easier way just select and do some command I
don't know
about


Your help is appretiated

AvP




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
Excel Formulas are showing relative address, rather than absolute William Sporborg Excel Worksheet Functions 3 November 9th 07 01:04 PM
Copying formulas, relative and absolute cell references Garnet Excel Discussion (Misc queries) 3 February 22nd 07 08:51 AM
Excel: Cant copy an relative Cell and make absolute themantheworldlovesmorethannathan Excel Discussion (Misc queries) 1 August 22nd 06 11:26 PM
Changing formulas from relative to absolute Axel Excel Discussion (Misc queries) 5 June 14th 06 09:13 PM
Automatically making formulas "Absolute" or "$ Relative" JMATHES Excel Discussion (Misc queries) 4 August 27th 05 12:10 AM


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