View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Referencing another workbook using a variable for the sheet?

You downloaded and installed the morefunc addin, right?

If A3 contains the sheet name (0513 as text!) and that A3 is on the same sheet
as the cell with the formula:

=indirect.ext("'C:\Users\The King''s\Desktop\[test.xlsx]" & A3 &"'!A1")

if A3 is on a different sheet but the same workbook as the cell with the
formula:

=indirect.ext("'C:\Users\The King''s\Desktop\[test.xlsx]"
& 'sheet 99'!A3 &"'!A1")

If A3 contains the value 513, you'll need to format the value nicely:

=indirect.ext("'C:\Users\The King''s\Desktop\[test.xlsx]"
& text('sheet 99'!A3,"0000") &"'!A1")

If A3 contains a date (say May 13, 2010):

=indirect.ext("'C:\Users\The King''s\Desktop\[test.xlsx]"
& text('sheet 99'!A3,"mmdd") &"'!A1")

(all untested. watch for typos.)

Doug wrote:

Thank you very much!
How would I need to type this in? This is what I have and it gives me an
error "A formula in this worksheet contains one or more invalid references."

='C:\Users\The
King''s\Desktop\[test.xlsx]INDIRECT.EXT([book2.xlsx]sheet1'!C1)'!A1
--
Thank you!

"Luke M" wrote:

Unfortunately, no. The closest thing is the INDIRECT function, but its
doesn't work on closed external workbooks. IF you're open to add-ins, take a
look he
http://www.download.com/Morefunc/300...-10423159.html

With the MoreFunc add-in, you can use the INDIRECT.EXT function, which would
allow you to do this.
--
Best Regards,

Luke M
"Doug" wrote in message
...
=[test.xls]sheet1!A1

Is it possible to make the "sheet1" portion of this formula tied to a cell
in the destination workbook so that if I type "sheet2" in cell A3 of my
destination sheet, it will show what is in cell A1 of =[test.xls]sheet2!A1

What I am trying to do is make all the references in my workbook dependent
on what sheet# I have typed into cell A3. Up till now I have been fetching
all the data based on a 4 digit date format such as "0513". "0513" would
be
the name of a sheet that was saved with data for may 13th. My hope is to
be
able to type 0513 into cell A3 and have it reference the data. Can this be
done or is there a better way?

Also I noticed that in order to update the formula cell I have to select
the
test workbook in the dialog box each time. Is there a way to make this a
constant reference instead of having to ok it? Hopefully without having to
open the reference workbook each time either?

I am rather new to this...

--
Thank you!



.


--

Dave Peterson