find the source of a cell

bkelly

Active Member
Joined
Jan 28, 2005
Messages
465
I need to extract some data from a rather complex workbook with about a bunch of worksheets. Starting from one worksheet, I need to trace the source of some cells back through two or more worksheets to their origins, then fetch the data from other cells in the originating workseet. (Hopefully my terminology is valid.)

(I.e. Worksheet First cell A1 is a direct copy of Worksheet Second cell B2. The formula for A1 is "=Second!B2" My VBA code needs to discover worksheet Second and fetch data from that worksheet. And maybe worksheet Second is fed from worksheet Third cell C4.)

My current thoughts are to check the formula of the cell. If it contains "=" then I can examine the text of the formula and extract the name of the next worksheet. When there are no more "=" symbols the originating cell has been discovered.

However, I suspect there is a more elegant method of accomplishing this. What is the best method for this task?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Related question: When the cell in focus has as its formula: "=Sheet3!C3" is there a keyboard shortcut that will move me directly to Sheet3?
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,337
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top