Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default extract formula result form cell without running formula again

On Aug 6, 2:40*pm, jason wrote:
hello,
i have a routine that outputs a very long routing into a cell.
i want to then take this result and make use of it in another
calculation.
how can i take the resulting value without executing the entire
function again?
thanks!


** in vba.
so basically
cells(1,1)=routine()

cells(1,2)=cells(1,1) +1 (for example)

i tried .value and .evaluate with no luck.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default extract formula result form cell without running formula again

On Thu, 6 Aug 2009 11:41:41 -0700 (PDT), jason wrote:

On Aug 6, 2:40*pm, jason wrote:
hello,
i have a routine that outputs a very long routing into a cell.
i want to then take this result and make use of it in another
calculation.
how can i take the resulting value without executing the entire
function again?
thanks!


** in vba.
so basically
cells(1,1)=routine()

cells(1,2)=cells(1,1) +1 (for example)

i tried .value and .evaluate with no luck.


Without your posting your code, I would think that

cells(1,2).value = cells(1,1).value + 1

should work.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default extract formula result form cell without running formula again

On Thu, 6 Aug 2009 11:41:41 -0700 (PDT), jason wrote:

On Aug 6, 2:40*pm, jason wrote:
hello,
i have a routine that outputs a very long routing into a cell.
i want to then take this result and make use of it in another
calculation.
how can i take the resulting value without executing the entire
function again?
thanks!


** in vba.
so basically
cells(1,1)=routine()

cells(1,2)=cells(1,1) +1 (for example)

i tried .value and .evaluate with no luck.


To expand on what I just wrote, whether you can do this or not may depend on
information you have not shared with us.

For example, if you are trying to do this as part of a VBA Function, it will
not work as a function can only output a value. I have assumed you have done
this as part of a macro (Sub) since I have assumed that a "very long routing"
means some kind of formula that you have placed into cells(1,1).

That being the case, there may be more efficient ways of solving your entire
problem.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default extract formula result form cell without running formula again

On Aug 6, 4:38*pm, Ron Rosenfeld wrote:
On Thu, 6 Aug 2009 11:41:41 -0700 (PDT), jason wrote:
On Aug 6, 2:40*pm, jason wrote:
hello,
i have a routine that outputs a very long routing into a cell.
i want to then take this result and make use of it in another
calculation.
how can i take the resulting value without executing the entire
function again?
thanks!


** in vba.
so basically
cells(1,1)=routine()


cells(1,2)=cells(1,1) +1 (for example)


i tried .value and .evaluate with no luck.


To expand on what I just wrote, whether you can do this or not may depend on
information you have not shared with us.

For example, if you are trying to do this as part of a VBA Function, it will
not work as a function can only output a value. *I have assumed you have done
this as part of a macro (Sub) since I have assumed that a "very long routing"
means some kind of formula that you have placed into cells(1,1).

That being the case, there may be more efficient ways of solving your entire
problem.
--ron- Hide quoted text -

- Show quoted text -


ron,
thanks for taking the time.
i realize how trivial the question seems.
basically:

cells(1,1)=4/8/2009
cells(1,1).numberformat="m/d/yy;@"
cells(1,1) [DISPLAYS] 4/8/09
i want to extract JUST 4/8/09
not 4/8/2009

this is my issue.
i've tried .text and .value

not sure, but any help would be huge.
thanks
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default extract formula result form cell without running formula again

On Tue, 11 Aug 2009 09:54:04 -0700 (PDT), jason
wrote:

ron,
thanks for taking the time.
i realize how trivial the question seems.
basically:

cells(1,1)=4/8/2009
cells(1,1).numberformat="m/d/yy;@"
cells(1,1) [DISPLAYS] 4/8/09
i want to extract JUST 4/8/09
not 4/8/2009

this is my issue.
i've tried .text and .value

not sure, but any help would be huge.
thanks


I'm probably still not understanding what it is you want to do, but your
example is simple enough.

If you want to extract the result as Excel has formatted it, merely use the
..text property.

e.g:

=========================
ption Explicit
Sub foo()
Dim s As String
With Cells(1, 1)
.Value = DateSerial(2009, 4, 8)
.NumberFormat = "m/d/yy;@"
End With
s = Cells(1, 1).Text
Debug.Print s
End Sub
==============================

The immediate window will show 4/8/09
--ron
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
Formula (off form) that completes form data based on a result lldiel Excel Worksheet Functions 2 November 24th 09 11:09 PM
extract formula result form cell without running formula again jason Excel Programming 0 August 6th 09 07:40 PM
cells show formula like in formula bar, rather than result of form James Irwin Excel Discussion (Misc queries) 2 December 18th 08 04:41 PM
Using the result of formula as part of reference to a cell in form Victor Excel Worksheet Functions 8 May 2nd 07 10:53 PM
Using the result of a cell's formula as an argument within a running macro? / More Worldman1 Excel Programming 2 May 26th 06 02:38 AM


All times are GMT +1. The time now is 04:19 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"