Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to turn a string into a formula?

I want to reference another sheet's cell contents based on a randomly
generated row number. So I do the following:

Say cell B1 has the formula "=INT(RAND()*10)" to generate a random row
number. Say the generated random number is 5.

Based on this I try to get the cell contents from another sheet with
this equation = ="Sheet1!A" & B1

But this formula ends up returning the string "Sheet1!A5" which is
correct, but like I said it returns a string and not a formula to grab
the cell contents of another sheet.

Anyone know how to make this string a formula?

tia, Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to turn a string into a formula?

Ray,

Try

=INDIRECT("Sheet1!A"&B1)

--

HTH

RP

"rocky" wrote in message
...
I want to reference another sheet's cell contents based on a randomly
generated row number. So I do the following:

Say cell B1 has the formula "=INT(RAND()*10)" to generate a random row
number. Say the generated random number is 5.

Based on this I try to get the cell contents from another sheet with
this equation = ="Sheet1!A" & B1

But this formula ends up returning the string "Sheet1!A5" which is
correct, but like I said it returns a string and not a formula to grab
the cell contents of another sheet.

Anyone know how to make this string a formula?

tia, Ray



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
How do you turn off the formula bar? wilder5 New Users to Excel 2 December 15th 09 12:15 AM
Want formula to turn to value by itself DougL Excel Discussion (Misc queries) 2 February 8th 08 01:09 PM
Turn Off Formula ? WhiteHawk New Users to Excel 5 May 4th 05 11:41 PM
Turn OFF Formula Bar??? Michael Vaughan Excel Programming 1 September 3rd 04 05:43 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


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

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"