Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Using a cell reference to refernce worksheet in another work book

I have 2 spreadsheets setup book1 and book2. Book1 contains multiple
rows of data for different companies (50 rows). Book2 contains some
historical data on those companies. Book2 is broken down into 1
worksheet per company for a total of 50 worksheets. I want to create a
formula on book1 that will pull the specified data from the
corresponding worksheet in book 2. In book 1 worksheet there is a field
that has the worksheet name in book 2 to pull the data from. I have
tried X:\companies\[HISTORICALWORKSHEET2.xls]A5'!$U$6

Where A5 is the cell reference containg the worksheet name.

Does anyone know if this is possible and if so the correct syntax.
Thanks in advance

Denis

  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

You can only use a built in function (INDIRECT) when all workbooks in
question are open, there are some workarounds

http://tinyurl.com/3nemj


Regards


Regards,

Peo Sjoblom

" wrote:

I have 2 spreadsheets setup book1 and book2. Book1 contains multiple
rows of data for different companies (50 rows). Book2 contains some
historical data on those companies. Book2 is broken down into 1
worksheet per company for a total of 50 worksheets. I want to create a
formula on book1 that will pull the specified data from the
corresponding worksheet in book 2. In book 1 worksheet there is a field
that has the worksheet name in book 2 to pull the data from. I have
tried X:\companies\[HISTORICALWORKSHEET2.xls]A5'!$U$6

Where A5 is the cell reference containg the worksheet name.

Does anyone know if this is possible and if so the correct syntax.
Thanks in advance

Denis


  #3   Report Post  
 
Posts: n/a
Default

All the workbooks are open when I am doing this. It is giving me a
syntax error when I try to use a cell name. If I change the A5 to the
actual name of the worksheet "company 1" then it works

  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

OK, if both workbooks are open then first of all you won't need the path so
this should be enough

=INDIRECT("[HISTORICALWORKSHEET2.xls]"&A5&"!$U$6")

note that it will retrun a ref error when the workbook is closed and the
link I posted have some solutions for that

Regards,

Peo Sjoblom

" wrote:

All the workbooks are open when I am doing this. It is giving me a
syntax error when I try to use a cell name. If I change the A5 to the
actual name of the worksheet "company 1" then it works


  #5   Report Post  
 
Posts: n/a
Default

Peo Sjoblom wrote...
OK, if both workbooks are open then first of all you won't need the

path so
this should be enough

=INDIRECT("[HISTORICALWORKSHEET2.xls]"&A5&"!$U$6")

note that it will retrun a ref error when the workbook is closed and

the
link I posted have some solutions for that

....

Safer always to include single quotes around the workbook and worksheet
names.

=INDIRECT("'[HISTORICALWORKSHEET2.xls]"&A5&"'!$U$6")



  #6   Report Post  
 
Posts: n/a
Default

Adding the single quotes did the trick. thanks for ou help

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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
cell value as a worksheet reference Stepney_Clint Excel Worksheet Functions 2 January 3rd 05 05:03 PM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
name of another worksheet in cell for reference Tom A Johnson Excel Worksheet Functions 2 November 11th 04 11:28 PM


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