ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   insert contents of variable cell address (https://www.excelbanter.com/excel-discussion-misc-queries/235429-insert-contents-variable-cell-address.html)

Charlie@ParkViewTerrace

insert contents of variable cell address
 
I have a spreadsheet with same income/expense line items (rows) for each of
the 12 months. Each sheet has the same row line items and each sheet has the
same 12 columns for months. I have 3 years of data : 2007, 2008, and 2009.
Each year is its own sheet. I want to make a summary sheet where a month/year
is entered and 3 columns are displayed: the same line items for month A 2009
adjacent to the same line items for month A 2008, and the same line items for
month A 2007.

Since sheet name and row are set the only real variable is month. I can
compute the column portion of cell address by using char(65) + month(selected
month/year) but what I get is a cell whose contents are the computed address
rather than the contents of the computed cell address. I tried using
cell("contents", with computed address but I just get errors). Am I
violating an Excel law by computing a cell address and trying to load the
contents of that cell into the same cell where the address was computed?
Does this require a macro? Our local expert is stumped.

Office 2007 Excel Vista

jamescox[_6_]

insert contents of variable cell address
 

I got a bit lost in your explanation, but it seems like the customized
equivalent of

=INDIRECT(CONCATENATE("Sheet3!","B","7"),TRUE)

where the CONCATENATE builds the address of the cell whose value you
want should work for you...

Of course, you could use cell references to provide parts of the
address or the CHAR function, ie


=INDIRECT(CONCATENATE(J4,CHAR(66),"7"),TRUE)

Assuming that J4 on the local sheet has the text

Sheet3!

in it.

Hope this helps!


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=111480



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com