Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default change a formula

Hi, is there a programming way to change this:
Cell A10=A2+B2
into this
Cell A10=$a$2+B2
Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default change a formula

select the cell
hit F2
highlight the A2 part
F4 - each F4 toggles through the absolute/relative combinations

--
HTH

Bob Phillips

"jobra" wrote in message
...
Hi, is there a programming way to change this:
Cell A10=A2+B2
into this
Cell A10=$a$2+B2
Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default change a formula

The built in function
sForm = "=A2+B2"
? application.ConvertFormula(sForm,xlA1,xlA1,xlAbsol ute)
=$A$2+$B$2

will not work on just one argument, so you would have to develop custom code
to do the conversion.

You can get the directprecedents

? Range("A10").DirectPrecedents.Address
$A$2:$B$2


but this doesn't seem real useful in this case.

? replace(sForm,"A2","$A$2")
=$A$2+B2

is a very specific solution. You would have to state your real need and
what the conditions are.

--
Regards,
Tom Ogilvy

"jobra" wrote in message
...
Hi, is there a programming way to change this:
Cell A10=A2+B2
into this
Cell A10=$a$2+B2
Thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default change a formula



"Bob Phillips" wrote:

select the cell
hit F2
highlight the A2 part
F4 - each F4 toggles through the absolute/relative combinations

-- Thanks Bob, but do you know a way to program this into a macro?


HTH

Bob Phillips

"jobra" wrote in message
...
Hi, is there a programming way to change this:
Cell A10=A2+B2
into this
Cell A10=$a$2+B2
Thanks in advance




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
change formula in a shared worksheet without losing change history DCE Excel Worksheet Functions 5 July 25th 08 01:37 PM
how to change formula in shared sheet without loss of change histo DCE Excel Worksheet Functions 1 July 23rd 08 05:09 PM
change color of all cells with formula or are part of a formula [email protected] Excel Discussion (Misc queries) 19 January 28th 08 01:21 AM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
How does Data Validation change with a formula change? MayClarkOriginals Excel Worksheet Functions 3 July 5th 06 04:50 AM


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