Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding referenced worksheets used in a worksheet
I know how to find external workbook links - is there a VBA function
or perhaps someone has written code to find external worksheet references to a given sheet from other sheets in the workbook. Here's what I mean: sheet1 has some formulas in various cells. Some of these pull in values from sheet2 and sheet3. My first inclination is to scan through all the formulas in sheet1's UsedRange using the instr function and look for the ! which would have to appear after the reference to an external sheet. I then would need to do quite a bit of parsing to first establish the sheet name ( my thought was a loop of all sheet names used in instr function until I get a value 0 on the string between the beginning of the string and the ! ). Next I would have to search the remaining string, exhaustively, with the same process to account for multiple occurences of external references. If I also want to capture the range after the ! there would be even more parsing to the right. I appreciate any help that would make this easier. Thanks All. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding referenced worksheets used in a worksheet
Well,
I did more research and after coming up with the correct terminology for what I am looking to do I realize why all the experts avoided this post like the plague. What it is that I am attempting to do is apparently not sleek or sexy - it is to follow precedents using the range property .ShowPrecedents and the .NavigateArrow through to the other sheets and collect these range references as I go. I will then run them through a collection object to delete all dups. Dim refColl as new Collection on error resume next refColl.add myRef, cstr(myref) on error goto 0 The resulting list will give me those ranges which are key to the formula on a given page. If anyone knows of any better way to extract the external sheet links to a cell (ie. find the precendents) than those posted here in the past - please share. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summarize a range referenced in a separate worksheet | Excel Discussion (Misc queries) | |||
Find and return name of worksheet tab for referenced cell | Excel Worksheet Functions | |||
Need fucntion to reference cell on worksheet referenced by known n | Excel Worksheet Functions | |||
has a cell been referenced in another worksheet | Excel Discussion (Misc queries) | |||
Creating a master sheet referenced to multiple worksheets | Excel Discussion (Misc queries) |