Computing.Net > Forums > Office Software > Extract cell reference from formula

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Extract cell reference from formula

Reply to Message Icon

Name: micklee30
Date: February 18, 2009 at 02:18:33 Pacific
OS: Windows Vista
Subcategory: Microsoft Office
Comment:

Hi,
I want to extract the cell reference from within a formula and can't for the life of me think how to do it !
Let's say in A1 i've entered a date. Cells A2 to A10 all point at cell A1 (so the formula on all those cells reads =A1).
What I want to do is this: In the corresponding cell in column B I want to show what cell is referenced in the cells in column A. So, in B1 it would probably return something odd (because there's no formula in A1), but in cells B2:B10 it would return "A1".
I won't bore you with the reason for needing this. Suffice to say i've got a complex spreadsheet that i've managed to mess up by virtue of applying some sort criteria and i'm trying to restore the data to it's original state.
Thanks
Mick



Sponsored Link
Ads by Google

Response Number 1
Name: jon_k
Date: February 18, 2009 at 04:07:09 Pacific
Reply:

What I would do is use find and replace.

First right click on the worksheet tab, and choose "move or copy", shove it at the end and create a copy.

On the copy, highlight the cells you want to get the formula of, CTRL-H and replace = with ' (a single quote). Then copy this whole column and paste special (values) on the sheet that is current. Should give you your desired result.

If you have any IF formulae, this will make the cell look a bit odd, but I can't think of a way around this.

Failing this, you could try looking at VBA Range.Dependents property.


0

Response Number 2
Name: micklee30
Date: February 18, 2009 at 04:18:34 Pacific
Reply:

Hi,
Thanks ! That did do exactly what I wanted to do. Unfortunately it didn't solve my problem ! I don't think i've much option but to start again. Thanks for the tip though - annoyed I didn't think of it myself !!
Cheers
Mick


0

Response Number 3
Name: DerbyDad03
Date: February 18, 2009 at 06:34:25 Pacific
Reply:

Would using Tools...Options...View Tab...Check the Formulas box work for you?

That would show the formula in each cell, so instead of them appearing in column B, they would show up in the actual cell in which they reside.


0

Response Number 4
Name: Mike (by mmcconaghy)
Date: February 18, 2009 at 06:50:37 Pacific
Reply:

You could try the CELL function.

Something like:

=CELL("address",A3)

There are a whole host of attributes that the CELL function returns, like the "contents", "Col", "Row", etc. etc.

MIKE


0

Response Number 5
Name: micklee30
Date: February 18, 2009 at 07:05:08 Pacific
Reply:

Thanks for all the replies. It looks like the 'problem' occurred at some other stage of me working in the sheet. I thought the sort i'd done had maybe screwed around with the formulas (although I know it shouldn't) or maybe a result of switching between different versions of Excel (2007 vs earlier versions). It looks like it was probably something more basic than that - ie user error !
Anyway, sorted now by me starting the piece of work again.
Thanks again for the replies.
Cheers
Mick


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Assigning a function to e... How to create combo box i...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Extract cell reference from formula

Excel Dynamic Cell Reference www.computing.net/answers/office/excel-dynamic-cell-reference/8797.html

excel formula to change cell addres www.computing.net/answers/office/excel-formula-to-change-cell-addres/5899.html

Excel: cell contains string from range www.computing.net/answers/office/excel-cell-contains-string-from-range/8984.html