Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How can I use a cell value to reference a row?

a5 is an integer variable from 15 to 925 in increments of 1. When a5 is 20
cell a10 (or any cell I chose) should read the contents of j20. When a5 is
825 cell a10 should read the contents of j825. The integer value in a5
defines the row of column j returned in cell a10.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default How can I use a cell value to reference a row?

Take a look at the indirect function in Excel It will allow you to set your
reference dynamically. Something like this

=INDIRECT("Sheet1!J" & A5)
--
HTH...

Jim Thomlinson


"excelchallenged" wrote:

a5 is an integer variable from 15 to 925 in increments of 1. When a5 is 20
cell a10 (or any cell I chose) should read the contents of j20. When a5 is
825 cell a10 should read the contents of j825. The integer value in a5
defines the row of column j returned in cell a10.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I use a cell value to reference a row?


Hello Excelchallenged,

In cell A10 place the formula...
=INDIRECT("J" & A5)

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=509173

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I use a cell value to reference a row?


excelchallenged Wrote:
a5 is an integer variable from 15 to 925 in increments of 1. When a5 i
20
cell a10 (or any cell I chose) should read the contents of j20. When a
is
825 cell a10 should read the contents of j825. The integer value in a5
defines the row of column j returned in cell a10.


why not
temp=[A5]
cells(10,"A").value=cells(temp,"j").value

A V Veerka

--
avveerka
-----------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...fo&userid=3033
View this thread: http://www.excelforum.com/showthread.php?threadid=50917

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default How can I use a cell value to reference a row?

While indirect is a volitile function meaning that it will recalcualte every
thime the sheet calculates it will (in all likelyhood) still be more
efficient than using the on change event handler that you are proposing.
Built in functions are almost always more efficient than code. If you want to
try it though be my guest. It will work...
--
HTH...

Jim Thomlinson


"avveerkar" wrote:


excelchallenged Wrote:
a5 is an integer variable from 15 to 925 in increments of 1. When a5 is
20
cell a10 (or any cell I chose) should read the contents of j20. When a5
is
825 cell a10 should read the contents of j825. The integer value in a5
defines the row of column j returned in cell a10.


why not
temp=[A5]
cells(10,"A").value=cells(temp,"j").value

A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=509173


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
Changing sheet reference to cell reference TeeJay Excel Worksheet Functions 3 October 19th 07 11:50 AM
Formulas that reference cells that reference another cell Andrea Excel Discussion (Misc queries) 7 October 19th 06 08:14 AM
absolute cell reference A spreadsheet cell reference that does no help Excel Discussion (Misc queries) 1 January 18th 06 06:56 PM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


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