Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Reference workbook name to cell reference

Hi,

I have this line of code in workbook "Team 3.xls":
Sheets("Output").Copy After:=Workbooks("11_07 Summary Team
3.xls").Sheets(1)

Rather than manually replacing the name of the workbook each month (eg to
12_07 Summary Team 3.xls etc), is it possible to reference the workbook name
("11_07 Summary Team 3.xls") to a cell reference, say
Sheets("Data").Range("J11") which resides in Team 3.xls.

Any assistance appreciated.

Cheers

Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Reference workbook name to cell reference

The parameter in the workbook function is a string a any string referrence
can be used. I would add an intermediate variable to make it easier to
understand the code

bookname = Sheets("Data").Range("J11")
Sheets("Output").Copy After:=Workbooks(bookname).Sheets(1)


"Bob Maloney" wrote:

Hi,

I have this line of code in workbook "Team 3.xls":
Sheets("Output").Copy After:=Workbooks("11_07 Summary Team
3.xls").Sheets(1)

Rather than manually replacing the name of the workbook each month (eg to
12_07 Summary Team 3.xls etc), is it possible to reference the workbook name
("11_07 Summary Team 3.xls") to a cell reference, say
Sheets("Data").Range("J11") which resides in Team 3.xls.

Any assistance appreciated.

Cheers

Bob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Reference workbook name to cell reference

Many thanks, Joel.

Cheers

Bob

"Joel" wrote in message
...
The parameter in the workbook function is a string a any string referrence
can be used. I would add an intermediate variable to make it easier to
understand the code

bookname = Sheets("Data").Range("J11")
Sheets("Output").Copy After:=Workbooks(bookname).Sheets(1)


"Bob Maloney" wrote:

Hi,

I have this line of code in workbook "Team 3.xls":
Sheets("Output").Copy After:=Workbooks("11_07 Summary Team
3.xls").Sheets(1)

Rather than manually replacing the name of the workbook each month (eg to
12_07 Summary Team 3.xls etc), is it possible to reference the workbook
name
("11_07 Summary Team 3.xls") to a cell reference, say
Sheets("Data").Range("J11") which resides in Team 3.xls.

Any assistance appreciated.

Cheers

Bob





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
Providing a reference to another cell in a different workbook Darren Excel Worksheet Functions 2 May 25th 07 11:32 PM
workbook/cell reference w/ formula waladd Excel Worksheet Functions 4 February 17th 07 03:16 PM
Use the value of a cell within a reference to another workbook? MR Excel Worksheet Functions 1 August 1st 06 05:41 PM
cell reference in another workbook Corben Excel Discussion (Misc queries) 3 April 29th 06 10:03 AM
cell reference in another workbook spence[_3_] Excel Programming 1 February 5th 04 03:50 AM


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