#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Formula Precedents

Hi All,

I am writing a macro where I want to change the range of cells referenced in
a formula to a new range. I was planning on trying to somehow get a string
variable (called strRangeO) to be equal to the precedent cells the formula
refers too and replace it with a new string variable (called strRangeN).
strRangeN would be equal to the new selected range address as per below:

strRangeN = Range(ActiveCell,ActiveCell.Offset(0,3)).Address(x lA1)

My problem is that I can't seem to find the function that will let me
populate strRangeO with the current address of the range the fromula refers
too.

Can anyone help?

Brendan
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Formula Precedents


Hi Brendan,

If the formula is in A1, Range("A1").Precedents.Address returns the
address of the precedents.

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Formula Precedents

Ken,

I tried the code below and got an error stating that "no cells were found".
I forgot to mention that the formula and the precedent cells are on different
sheets of the spreadsheet.

Can you suggest an amendment to your code below that may help?

Brendan

"Ken Johnson" wrote:


Hi Brendan,

If the formula is in A1, Range("A1").Precedents.Address returns the
address of the precedents.

Ken Johnson


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
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Locking portions of a formula tiggatattoo Excel Worksheet Functions 2 June 5th 06 04:51 PM
assign formula to another cell Dannycol Excel Worksheet Functions 3 May 12th 06 09:46 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
I want to trace the precedents in a formula when they are on mult. Paul Excel Discussion (Misc queries) 3 January 29th 05 09:17 AM


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