LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Problem using DirectDependents

I can't get the following function to return the direct dependents

Function ResolveFormula(ByRef rngCell As Range, iColLabels As Integer) As
String
Dim sCell As String
Dim rngPrec As Range

sCell = rngCell.Formula

For Each rngPrec In rngCell.DirectPrecedents
With rngPrec
sCell = Replace(sCell, rngPrec.Address(False, False, xlA1), _
.Offset(0, iColLabels - .Column + 1).Value)
End With
Next rngPrec

ResolveFormula = sCell
End Function

For the worksheet
A 1
B 2
=B1 * B2 =ResolveFormula(B3, 1)

to give =A * B

TIA
Kevin Beckham


 
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
DirectDependents not working properly. [email protected] Excel Programming 1 February 3rd 08 03:39 AM
What's the difference between .Dependents and .DirectDependents? [email protected] Excel Programming 4 February 3rd 08 03:27 AM
Finding when there are no directdependents [email protected] Excel Programming 1 June 19th 06 10:46 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"