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: 43
Default What VBA function returns cell 2 from which cell 1 gets its value?

This is a simple and possibly embarrassing question.

In Excel 2002 SP3, cell 1 is on ProfitSheet and depends on cell 2, on
a different sheet.

Cell 1 has a UDF, so it looks like:

"=MassageData(SalesSheet!$A$1)"

Given that I know cell 1 at runtime, what VBA function returns cell 2?

I have tried:

Set Cel2 = Cel1.Precedents(1)
Set Cel2 = Cel1.Precedents.Cells(1, 1)
etc.

but that only seems to return Cel1 itself (at least that's what the
Debug Window shows).

1) Is my syntax wrong?

2) Is Excel's lack of external dependent/precedent functionality in my
old version, the reason?

3) If so, has that un-feature ever been fixed?

I guess I could manually remove the UDF and do:

Set Cel2 = Range(StripTheEqualSignAndUDFFrom(Cel1.Formula))

or maybe this sickness (if I have the syntax right):

Set Cel2 =
Application.WorksheetFunction.INDIRECT(StripDitto( Cel1.Formula))

But what's the simple way that's staring me in the face?

Thanks much.

***
 
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
function that returns cell and or font color of another cell Mark Kubicki[_2_] Excel Programming 2 May 30th 08 03:31 PM
IF function which returns the text from a cell Wilhelm Excel Worksheet Functions 1 July 6th 06 09:14 AM
Function that Returns address of that cell? RayWolfDog Excel Worksheet Functions 2 February 15th 06 04:54 PM
A function that returns the name of the current cell yarp Excel Discussion (Misc queries) 17 August 9th 05 09:44 AM
If function that returns value in a cell. rayteach Excel Worksheet Functions 4 June 6th 05 03:26 AM


All times are GMT +1. The time now is 05:32 AM.

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"