Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
function that returns cell and or font color of another cell | Excel Programming | |||
IF function which returns the text from a cell | Excel Worksheet Functions | |||
Function that Returns address of that cell? | Excel Worksheet Functions | |||
A function that returns the name of the current cell | Excel Discussion (Misc queries) | |||
If function that returns value in a cell. | Excel Worksheet Functions |