View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default How Determine, cell has got reference.

Sorry, that doesn't answer your question at all, will look later

Regards,
Peter T

"Peter T" <peter_t@discussions wrote in message
...
Hi Kris,

Sub Test()
Dim cel As Range, ar As Range
Dim rDeps As Range, rDirDeps As Range, rDirPrecs As Range

Set cel = Range("B2")

On Error Resume Next
Set rDeps = cel.Dependents
Set rDirDeps = cel.DirectDependents
Set rDirPrecs = cel.DirectPrecedents
On Error GoTo 0

If Not rDeps Is Nothing Then
For Each ar In rDeps.Areas
Debug.Print ar.Address
For Each c In ar.Cells
Debug.Print , c.Address
Next
Next
End If
If Not rDirDeps Is Nothing Then
For Each ar In rDirDeps.Areas
Debug.Print ar.Address
For Each c In ar.Cells
Debug.Print , c.Address
Next
Next
End If

If Not rDirPrecs Is Nothing Then
For Each ar In rDirPrecs.Areas
Debug.Print ar.Address
For Each c In ar.Cells
Debug.Print , c.Address
Next
Next
End If

End Sub

Regards,
Peter T


"kris" wrote in message
...
Hi, Kris here
I want to know how to determine wheather a cell in a worksheet has got
reference to other workshhet or reference in the same worksheet.

Thanks