Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Return formula in cell

XL 2003
Would like to return the address of a formula to a cell, need some
combination of Indirect and Cell (address) I think,

Example
A1 100 ( a value)
A2 = a1
A3 want to return cell addresss that formula in A2 is pointing to (ie
A1) =cell("address",a2......here's where I need the help

It would be complex if A2 had mulitple pointers, but in my case they
are just 1 cell
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Return formula in cell

You need to use VBA. Copy the code below into a codemodule of the workbook, and use it like

=PointsTo(A2)

HTH,
Bernie
MS Excel MVP

Function PointsTo(myC As Range) As String
If myC.HasFormula Then
PointsTo = Mid(myC.Formula, 2)
Else
PointsTo = "No formula"
End If
End Function


wrote in message
...
XL 2003
Would like to return the address of a formula to a cell, need some
combination of Indirect and Cell (address) I think,

Example
A1 100 ( a value)
A2 = a1
A3 want to return cell addresss that formula in A2 is pointing to (ie
A1) =cell("address",a2......here's where I need the help

It would be complex if A2 had mulitple pointers, but in my case they
are just 1 cell



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Return formula in cell

Say A2 contains the formula:

=A1+Z10

Select A2 and run:

Sub missive()
Set r = ActiveCell
r.Offset(1, 0).Value = r.Precedents.Address
End Sub

A3 will contain:

$A$1,$Z$10

--
Gary''s Student - gsnu2007d


" wrote:

XL 2003
Would like to return the address of a formula to a cell, need some
combination of Indirect and Cell (address) I think,

Example
A1 100 ( a value)
A2 = a1
A3 want to return cell addresss that formula in A2 is pointing to (ie
A1) =cell("address",a2......here's where I need the help

It would be complex if A2 had mulitple pointers, but in my case they
are just 1 cell

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
return an EMPTY cell in an IF formula JJN Excel Discussion (Misc queries) 3 February 10th 06 04:14 PM
Formula to return cell position AJPendragon Excel Worksheet Functions 1 February 6th 06 09:34 PM
function CELL() to return the formula in the referenced cell Streep Excel Worksheet Functions 3 August 20th 05 10:24 PM
formula to return certain cell jerry Excel Discussion (Misc queries) 1 June 23rd 05 11:28 PM
Formula to return the name of a cell Adresmith Excel Discussion (Misc queries) 2 June 14th 05 07:31 PM


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