Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Claiming Dependents

That is strange. If I enter =dep(A1) in cell H3, it returns $A$1, just
as you said. But if I run this macro

Sub dep3()
MsgBox dep(Range("A1"))
End Sub

then it returns $B$1,$H$3. Curiouser and curiouser. How can the same
function return two different results? Somebody smart is going to have
to figure this one out. James

Gary''s Student wrote:
In A1 I have 1
In B1 I have the formula =A1

When I run:

Sub dep2()
MsgBox (Range("A1").DirectDependents.Address)
End Sub

It correctly returns $B$1

The UDF, however

Function dep(r As Range) As String
dep = r.Dependents.Address
End Function

When used as
=dep(A1)
returns $A$1 Why?
--
Gary's Student


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Claiming Dependents

I did a quick google search and came across this previous post with
exactly the same problem:

http://groups.google.co.uk/group/mic...1305fa10e75dff

Chip Pearson says it can't be done so its likely it can't be done.

James

Zone wrote:
That is strange. If I enter =dep(A1) in cell H3, it returns $A$1, just
as you said. But if I run this macro

Sub dep3()
MsgBox dep(Range("A1"))
End Sub

then it returns $B$1,$H$3. Curiouser and curiouser. How can the same
function return two different results? Somebody smart is going to have
to figure this one out. James

Gary''s Student wrote:
In A1 I have 1
In B1 I have the formula =A1

When I run:

Sub dep2()
MsgBox (Range("A1").DirectDependents.Address)
End Sub

It correctly returns $B$1

The UDF, however

Function dep(r As Range) As String
dep = r.Dependents.Address
End Function

When used as
=dep(A1)
returns $A$1 Why?
--
Gary's Student


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
UDF FOR DEPENDENTS Faraz A. Qureshi Excel Discussion (Misc queries) 0 June 26th 09 05:02 AM
In Between Dates Double Claiming Kumar Excel Discussion (Misc queries) 0 April 14th 09 04:30 PM
Claiming Dependents [email protected] Excel Programming 0 December 22nd 06 03:30 PM
trace dependents Susan B Excel Worksheet Functions 0 November 20th 06 10:28 PM
Dependents kt Excel Programming 1 June 11th 05 03:10 AM


All times are GMT +1. The time now is 10:04 PM.

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"