Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Extracting 'exact' local references from formula

Is there any way to get the exact string representing the local
references as the user entered it in the formula?

For example:

Cell A1 in Sheet1: "=Sheet2!G66+Sheet1!B$7-$A9"

Getting DirectPrecedents yields:
"$B$7" and "$A$9" for Address

What I *really* want is:
"Sheet1!B$7" and "$A9"

The frustrating thing is when I double click in the cell (edit mode)
Excel will colour these exact strings - But I can't find anyway of
getting to them in a macro :-(

Any help appreciated!

Antony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Extracting 'exact' local references from formula

Antony,

A bit nasty, but is this of any use

Set rng = ActiveCell.DirectPrecedents
For Each area In rng.Areas
Debug.Print area.Parent.Name & "!" & area.Address
Next area


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ant Bewes" wrote in message
om...
Is there any way to get the exact string representing the local
references as the user entered it in the formula?

For example:

Cell A1 in Sheet1: "=Sheet2!G66+Sheet1!B$7-$A9"

Getting DirectPrecedents yields:
"$B$7" and "$A$9" for Address

What I *really* want is:
"Sheet1!B$7" and "$A9"

The frustrating thing is when I double click in the cell (edit mode)
Excel will colour these exact strings - But I can't find anyway of
getting to them in a macro :-(

Any help appreciated!

Antony



  #3   Report Post  
Posted to microsoft.public.excel.programming
ant ant is offline
external usenet poster
 
Posts: 1
Default Extracting 'exact' local references from formula


Thanks for the heads-up but I will need to preserve the nature of the
users reference, such as:

$A1 / A$1 / $A$1 or
R1C[1] / R[1]C1 / R[1]C[1] etc

Ant


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Extracting 'exact' local references from formula

Doesn't that do so?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ant" wrote in message
...

Thanks for the heads-up but I will need to preserve the nature of the
users reference, such as:

$A1 / A$1 / $A$1 or
R1C[1] / R[1]C1 / R[1]C[1] etc

Ant


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Extracting 'exact' local references from formula

Doesn't that do so?

um.. no!

This was the approach I originally took. I've actually solved the
bigger problem by a different means now - as ever! VBA is a real
obstacle course...


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
formula for local time and GMT? hsg Excel Worksheet Functions 1 January 9th 10 05:53 PM
Local references Strd M 37 Excel Discussion (Misc queries) 4 June 17th 08 03:51 PM
Extracting an exact phrase from a Cell mazalam Excel Discussion (Misc queries) 5 September 1st 05 08:23 PM
Reference styles and local/non-local formulae - international problems. Alan Howells[_2_] Excel Programming 2 February 24th 04 09:52 AM
How to references objects that exist on local or network drives that aren't open. Mike-hime Excel Programming 0 January 7th 04 10:15 PM


All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"