Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
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
Summarize a range referenced in a separate worksheet nitengale Excel Discussion (Misc queries) 3 March 23rd 10 08:36 PM
Find and return name of worksheet tab for referenced cell MMangen Excel Worksheet Functions 2 July 2nd 09 04:35 PM
Need fucntion to reference cell on worksheet referenced by known n JWirt Excel Worksheet Functions 3 March 2nd 09 06:18 AM
has a cell been referenced in another worksheet reedspencer Excel Discussion (Misc queries) 3 October 2nd 07 04:06 PM
Creating a master sheet referenced to multiple worksheets John Excel Discussion (Misc queries) 0 November 2nd 06 03:31 PM


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