Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If n.name = "Min" then
Computed_Value = *Compute*(n) Hi. I see you have a solution. Just to add...if you have a specific name in mind, here is my preference: Sub Demo() Dim MyMin '// If you have this formula... ActiveWorkbook.Names.Add "Min", _ "=((HOUR(Time_End)*60+MINUTE(Time_End))-(HOUR(Time_Start)*60+MINUTE(Time_Start)))-Time_Break" '// Then later in your code... MyMin = [Min] End Sub Another interesting variation to Gary's solution in some situations is to use Relative Addressing (no $ in address) Where this points to depends on where the active cell is when this named formula was added. =Sheet1!B10+Sheet1!B11 The answer to this evaluation depends on where the active cell is in the same relationship as when the named formula was generated. Sometimes, that can be really cool... - - - HTH :) Dana DeLouis JeremyJ wrote: Is there a way to grab the "Computed Value" or "Result" of a Named Formula with in a Worksheet with VBA? WorkSheet Name: Min=((HOUR(Time_End)*60+MINUTE(Time_End))-(HOUR(Time_Start)*60+MINUTE(Time_Start)))-Time_Break Sub Grab_Minute() Dim n As Name Dim Computed_Value As Long i = 1 For Each n In Names If n.name = "Min" then Computed_Value = *Compute*(n) End if Next n End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
EXCEL07 CELL FORMULAS WILL NOT COMPUTE TO A VALUE | Excel Worksheet Functions | |||
Named ranges and pasting formulas with named references | Excel Programming | |||
Formulas cut and paste but do not compute | Excel Worksheet Functions | |||
formulas will not compute | Excel Worksheet Functions | |||
Formulas that don't compute | Excel Worksheet Functions |