PC Review


Reply
Thread Tools Rate Thread

Access a cell's Formula, rather than Value

 
 
John Broderick
Guest
Posts: n/a
 
      18th May 2007
Hello all:

I would like to modify this formula so that I use the formula of the cell
specified by x,
rather than the value stored in the cell.

=CHOOSE(x, Sheet1!A1, Sheet2!A1)


Thanks,
John



 
Reply With Quote
 
 
 
 
Peo Sjoblom
Guest
Posts: n/a
 
      18th May 2007
Not possible, you would need VBA for this. I can't see how by using CHOOSE
you would be able to do this even if it was possible to get the formula to
replace x since x should be an index number either 1 or 2 (in this case) if
you have 2 values? Or have I totally misunderstood?



--
Regards,

Peo Sjoblom


"John Broderick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello all:
>
> I would like to modify this formula so that I use the formula of the cell
> specified by x,
> rather than the value stored in the cell.
>
> =CHOOSE(x, Sheet1!A1, Sheet2!A1)
>
>
> Thanks,
> John
>
>
>



 
Reply With Quote
 
John Broderick
Guest
Posts: n/a
 
      18th May 2007
Peo,

thanks for replying. Let me clarify:

x would be 1 or 2 based on the contents of another cell.
For example in Sheet3!A1 I have the formula:
=CHOOSE(A10, Sheet1!A1, Sheet2!A1)

If A10=1, I want the cell cotaining this formula to use the formula that
Sheet1!A1 has.
If A10=2, I want the cell cotaining this formula to use the formula that
Sheet2!A1 has.

Regards,
John


"Peo Sjoblom" <(E-Mail Removed)> wrote in message
news:u$qp%(E-Mail Removed)...
> Not possible, you would need VBA for this. I can't see how by using CHOOSE
> you would be able to do this even if it was possible to get the formula to
> replace x since x should be an index number either 1 or 2 (in this case)

if
> you have 2 values? Or have I totally misunderstood?
>
>
>
> --
> Regards,
>
> Peo Sjoblom
>
>
> "John Broderick" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello all:
> >
> > I would like to modify this formula so that I use the formula of the

cell
> > specified by x,
> > rather than the value stored in the cell.
> >
> > =CHOOSE(x, Sheet1!A1, Sheet2!A1)
> >
> >
> > Thanks,
> > John
> >
> >
> >

>
>



 
Reply With Quote
 
Ragdyer
Guest
Posts: n/a
 
      18th May 2007
It should work *exactly* like that, just as you have now!

What problem are you having?
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"John Broderick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Peo,
>
> thanks for replying. Let me clarify:
>
> x would be 1 or 2 based on the contents of another cell.
> For example in Sheet3!A1 I have the formula:
> =CHOOSE(A10, Sheet1!A1, Sheet2!A1)
>
> If A10=1, I want the cell cotaining this formula to use the formula that
> Sheet1!A1 has.
> If A10=2, I want the cell cotaining this formula to use the formula that
> Sheet2!A1 has.
>
> Regards,
> John
>
>
> "Peo Sjoblom" <(E-Mail Removed)> wrote in message
> news:u$qp%(E-Mail Removed)...
>> Not possible, you would need VBA for this. I can't see how by using
>> CHOOSE
>> you would be able to do this even if it was possible to get the formula
>> to
>> replace x since x should be an index number either 1 or 2 (in this case)

> if
>> you have 2 values? Or have I totally misunderstood?
>>
>>
>>
>> --
>> Regards,
>>
>> Peo Sjoblom
>>
>>
>> "John Broderick" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Hello all:
>> >
>> > I would like to modify this formula so that I use the formula of the

> cell
>> > specified by x,
>> > rather than the value stored in the cell.
>> >
>> > =CHOOSE(x, Sheet1!A1, Sheet2!A1)
>> >
>> >
>> > Thanks,
>> > John
>> >
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Peo Sjoblom
Guest
Posts: n/a
 
      18th May 2007
Ahh! I see, unfortunately you would still need something that would
evaluate the cell to return, however you can hard code formulas in the
CHOOSE formula like

=CHOOSE(A10, SUM(Sheet1!D15), Sheet2!A1)

as an example so basically you could use the formula that is in Sheet1!A1
and so on. If not you would need a UDF written in VBA


--
Regards,

Peo Sjoblom



"John Broderick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Peo,
>
> thanks for replying. Let me clarify:
>
> x would be 1 or 2 based on the contents of another cell.
> For example in Sheet3!A1 I have the formula:
> =CHOOSE(A10, Sheet1!A1, Sheet2!A1)
>
> If A10=1, I want the cell cotaining this formula to use the formula that
> Sheet1!A1 has.
> If A10=2, I want the cell cotaining this formula to use the formula that
> Sheet2!A1 has.
>
> Regards,
> John
>
>
> "Peo Sjoblom" <(E-Mail Removed)> wrote in message
> news:u$qp%(E-Mail Removed)...
>> Not possible, you would need VBA for this. I can't see how by using
>> CHOOSE
>> you would be able to do this even if it was possible to get the formula
>> to
>> replace x since x should be an index number either 1 or 2 (in this case)

> if
>> you have 2 values? Or have I totally misunderstood?
>>
>>
>>
>> --
>> Regards,
>>
>> Peo Sjoblom
>>
>>
>> "John Broderick" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Hello all:
>> >
>> > I would like to modify this formula so that I use the formula of the

> cell
>> > specified by x,
>> > rather than the value stored in the cell.
>> >
>> > =CHOOSE(x, Sheet1!A1, Sheet2!A1)
>> >
>> >
>> > Thanks,
>> > John
>> >
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
gumby
Guest
Posts: n/a
 
      18th May 2007
On May 18, 2:46 pm, "John Broderick" <n...@none.com> wrote:
> Peo,
>
> thanks for replying. Let me clarify:
>
> x would be 1 or 2 based on the contents of another cell.
> For example in Sheet3!A1 I have the formula:
> =CHOOSE(A10, Sheet1!A1, Sheet2!A1)
>
> If A10=1, I want the cell cotaining this formula to use the formula that
> Sheet1!A1 has.
> If A10=2, I want the cell cotaining this formula to use the formula that
> Sheet2!A1 has.
>
> Regards,
> John
>
> "Peo Sjoblom" <terr...@mvps.org> wrote in message
>
> news:u$qp%(E-Mail Removed)...
>
>
>
> > Not possible, you would need VBA for this. I can't see how by using CHOOSE
> > you would be able to do this even if it was possible to get the formula to
> > replace x since x should be an index number either 1 or 2 (in this case)

> if
> > you have 2 values? Or have I totally misunderstood?

>
> > --
> > Regards,

>
> > Peo Sjoblom

>
> > "John Broderick" <n...@none.com> wrote in message
> >news:(E-Mail Removed)...
> > > Hello all:

>
> > > I would like to modify this formula so that I use the formula of the

> cell
> > > specified by x,
> > > rather than the value stored in the cell.

>
> > > =CHOOSE(x, Sheet1!A1, Sheet2!A1)

>
> > > Thanks,
> > > John- Hide quoted text -

>
> - Show quoted text -


Look at the INDEX & INDIRECT functions, you may have to chance that
way. The Indirect function uses the sheet names.

=INDIRECT(SheetName &"!e2:e57")



Dave

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access to the value of a merged cell in a formula Zlika Microsoft Excel Programming 7 2nd Nov 2007 06:17 PM
Creating Excel SSheet in Access - How to Paste Formula into Cell Mike Thomas Microsoft Access Form Coding 2 29th Mar 2006 10:42 PM
possible with cell formula in access? rantz Microsoft Access 4 2nd Feb 2006 06:00 PM
Allow access to cell but don't change cells formula clayton Microsoft Excel Programming 1 22nd Jan 2004 07:31 PM
Excel 2000 - How to access hidden cell formula when protected with UserInterfaceOnly ? Lionel Gomes Microsoft Excel Discussion 1 29th Aug 2003 10:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 PM.