A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Linking two sheets in different books



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2005, 04:13 PM
Glenn Mulno
external usenet poster
 
Posts: n/a
Default Linking two sheets in different books

Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest data.

I wish to create several graphs that use all the data in file1.xls but can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a formula in
cell A1 of Sheet1 of file2.xls such that it pulled the entire contents of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not figure
out how I did this years ago and all the references I have found looking
around seem to only talk about bringing over only a few cells. For example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each run so I can
not just hard code a specific range of cells. I just want to pull in the
entire sheet from the first file into the second file and have it be a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if this is not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn


  #2  
Old January 4th, 2005, 04:51 PM
Bernie Deitrick
external usenet poster
 
Posts: n/a
Default

Glenn,

Open both the workbooks, and run this little macro:

Sub Glenn()
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
End Sub

This will, of course, remove any old data or formulas on Sheet1 of File2,
but won't affect any formulas on other sheets of File1. Those formulas
should probably be written to look at entire columns, to account for the
variable lengths.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest data.

I wish to create several graphs that use all the data in file1.xls but

can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a formula in
cell A1 of Sheet1 of file2.xls such that it pulled the entire contents of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not figure
out how I did this years ago and all the references I have found looking
around seem to only talk about bringing over only a few cells. For

example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each run so I

can
not just hard code a specific range of cells. I just want to pull in the
entire sheet from the first file into the second file and have it be a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if this is

not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn




  #3  
Old January 4th, 2005, 08:22 PM
Glenn Mulno
external usenet poster
 
Posts: n/a
Default

Thanks Bernie. One follow up:

This works fine but only when both documents are open (as you mentioned). I
can't seem to figure out how to make it work for when the first document is
still closed. To the end users - they will not even know of the existence
of the first source file.

Once upon a time (8+ years ago at another company), I did this by entering a
single formula in cell A1 of the destination file and it automatically
updated when the file opened. I can't remember what I did and can't find any
reference to it so I don't know if I was dreaming or if the support for this
was taken away years ago.

Anyway - Thanks again for the response. Any help on getting this to happen
with the first doc still closed would be great.

--
Glenn


"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

Open both the workbooks, and run this little macro:

Sub Glenn()
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
End Sub

This will, of course, remove any old data or formulas on Sheet1 of File2,
but won't affect any formulas on other sheets of File1. Those formulas
should probably be written to look at entire columns, to account for the
variable lengths.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest data.

I wish to create several graphs that use all the data in file1.xls but

can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a formula in
cell A1 of Sheet1 of file2.xls such that it pulled the entire contents

of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not

figure
out how I did this years ago and all the references I have found looking
around seem to only talk about bringing over only a few cells. For

example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each run so I

can
not just hard code a specific range of cells. I just want to pull in

the
entire sheet from the first file into the second file and have it be a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if this is

not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn






  #4  
Old January 4th, 2005, 10:00 PM
Bernie Deitrick
external usenet poster
 
Posts: n/a
Default

Glenn,

You weren't dreaming.

Open up both books, and in the one that you want to have open, go to cell A1
of sheet1. Type in an = then navigate to the other workbook, and select
cell A1 of sheet1. Press enter, and you should have a link formula. Copy
that formula to all the other cells of the sheet, but only as many as you
reasonably expect to need, otherwise the file will become too large.

Then close the book that you want to have closed. The formulas with then
reference the closed book. Save and close the book with the formula. Then
overwrite the other book (give the new fiel the same name), and when you
open up the book with the formulas, they - the formulas - will automatically
reference the new workbook.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Thanks Bernie. One follow up:

This works fine but only when both documents are open (as you mentioned).
I
can't seem to figure out how to make it work for when the first document
is
still closed. To the end users - they will not even know of the existence
of the first source file.

Once upon a time (8+ years ago at another company), I did this by entering
a
single formula in cell A1 of the destination file and it automatically
updated when the file opened. I can't remember what I did and can't find
any
reference to it so I don't know if I was dreaming or if the support for
this
was taken away years ago.

Anyway - Thanks again for the response. Any help on getting this to happen
with the first doc still closed would be great.

--
Glenn


"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

Open both the workbooks, and run this little macro:

Sub Glenn()
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
End Sub

This will, of course, remove any old data or formulas on Sheet1 of File2,
but won't affect any formulas on other sheets of File1. Those formulas
should probably be written to look at entire columns, to account for the
variable lengths.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest
data.

I wish to create several graphs that use all the data in file1.xls but

can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a formula
in
cell A1 of Sheet1 of file2.xls such that it pulled the entire contents

of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not

figure
out how I did this years ago and all the references I have found
looking
around seem to only talk about bringing over only a few cells. For

example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each run so
I

can
not just hard code a specific range of cells. I just want to pull in

the
entire sheet from the first file into the second file and have it be a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if this
is

not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn








  #5  
Old January 5th, 2005, 04:53 PM
Glenn Mulno
external usenet poster
 
Posts: n/a
Default

This pulls in more than I would want. If a cell is empty then I end up with
a 0 in a cell that was just empty on the source sheet. I want to pull in an
exact replica of what is in the other sheet - formatting and all.

Oh well - Thanks anyway!

--
Glenn

"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

You weren't dreaming.

Open up both books, and in the one that you want to have open, go to cell

A1
of sheet1. Type in an = then navigate to the other workbook, and select
cell A1 of sheet1. Press enter, and you should have a link formula. Copy
that formula to all the other cells of the sheet, but only as many as you
reasonably expect to need, otherwise the file will become too large.

Then close the book that you want to have closed. The formulas with then
reference the closed book. Save and close the book with the formula.

Then
overwrite the other book (give the new fiel the same name), and when you
open up the book with the formulas, they - the formulas - will

automatically
reference the new workbook.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Thanks Bernie. One follow up:

This works fine but only when both documents are open (as you

mentioned).
I
can't seem to figure out how to make it work for when the first document
is
still closed. To the end users - they will not even know of the

existence
of the first source file.

Once upon a time (8+ years ago at another company), I did this by

entering
a
single formula in cell A1 of the destination file and it automatically
updated when the file opened. I can't remember what I did and can't find
any
reference to it so I don't know if I was dreaming or if the support for
this
was taken away years ago.

Anyway - Thanks again for the response. Any help on getting this to

happen
with the first doc still closed would be great.

--
Glenn


"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

Open both the workbooks, and run this little macro:

Sub Glenn()
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
End Sub

This will, of course, remove any old data or formulas on Sheet1 of

File2,
but won't affect any formulas on other sheets of File1. Those formulas
should probably be written to look at entire columns, to account for

the
variable lengths.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest
data.

I wish to create several graphs that use all the data in file1.xls

but
can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a formula
in
cell A1 of Sheet1 of file2.xls such that it pulled the entire

contents
of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not

figure
out how I did this years ago and all the references I have found
looking
around seem to only talk about bringing over only a few cells. For
example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each run

so
I
can
not just hard code a specific range of cells. I just want to pull in

the
entire sheet from the first file into the second file and have it be

a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if this
is
not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn










  #6  
Old January 5th, 2005, 06:50 PM
Bernie Deitrick
external usenet poster
 
Posts: n/a
Default

Glenn,

You can't pull in formatting and truly empty cells unless you use a macro.

You could modify my original macro to open the workbook:

Sub Glenn2()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
Workbooks.Open "C:\FolderPath\File1.xls"
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
Workbooks("File1.xls").Close False
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
This pulls in more than I would want. If a cell is empty then I end up
with
a 0 in a cell that was just empty on the source sheet. I want to pull in
an
exact replica of what is in the other sheet - formatting and all.

Oh well - Thanks anyway!

--
Glenn

"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

You weren't dreaming.

Open up both books, and in the one that you want to have open, go to cell

A1
of sheet1. Type in an = then navigate to the other workbook, and select
cell A1 of sheet1. Press enter, and you should have a link formula. Copy
that formula to all the other cells of the sheet, but only as many as you
reasonably expect to need, otherwise the file will become too large.

Then close the book that you want to have closed. The formulas with then
reference the closed book. Save and close the book with the formula.

Then
overwrite the other book (give the new fiel the same name), and when you
open up the book with the formulas, they - the formulas - will

automatically
reference the new workbook.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Thanks Bernie. One follow up:

This works fine but only when both documents are open (as you

mentioned).
I
can't seem to figure out how to make it work for when the first
document
is
still closed. To the end users - they will not even know of the

existence
of the first source file.

Once upon a time (8+ years ago at another company), I did this by

entering
a
single formula in cell A1 of the destination file and it automatically
updated when the file opened. I can't remember what I did and can't
find
any
reference to it so I don't know if I was dreaming or if the support for
this
was taken away years ago.

Anyway - Thanks again for the response. Any help on getting this to

happen
with the first doc still closed would be great.

--
Glenn


"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

Open both the workbooks, and run this little macro:

Sub Glenn()
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
End Sub

This will, of course, remove any old data or formulas on Sheet1 of

File2,
but won't affect any formulas on other sheets of File1. Those
formulas
should probably be written to look at entire columns, to account for

the
variable lengths.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest
data.

I wish to create several graphs that use all the data in file1.xls

but
can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a
formula
in
cell A1 of Sheet1 of file2.xls such that it pulled the entire

contents
of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not
figure
out how I did this years ago and all the references I have found
looking
around seem to only talk about bringing over only a few cells. For
example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each run

so
I
can
not just hard code a specific range of cells. I just want to pull
in
the
entire sheet from the first file into the second file and have it be

a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if
this
is
not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn












  #7  
Old January 5th, 2005, 07:45 PM
Glenn Mulno
external usenet poster
 
Posts: n/a
Default

YES! Thank you very much! I then wrapped it in the Workbook_Open()
function so that it happens automatically but this appears to work
wonderfully.

Thanks again!

--
Glenn


"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

You can't pull in formatting and truly empty cells unless you use a macro.

You could modify my original macro to open the workbook:

Sub Glenn2()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
Workbooks.Open "C:\FolderPath\File1.xls"
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
Workbooks("File1.xls").Close False
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
This pulls in more than I would want. If a cell is empty then I end up
with
a 0 in a cell that was just empty on the source sheet. I want to pull

in
an
exact replica of what is in the other sheet - formatting and all.

Oh well - Thanks anyway!

--
Glenn

"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

You weren't dreaming.

Open up both books, and in the one that you want to have open, go to

cell
A1
of sheet1. Type in an = then navigate to the other workbook, and

select
cell A1 of sheet1. Press enter, and you should have a link formula.

Copy
that formula to all the other cells of the sheet, but only as many as

you
reasonably expect to need, otherwise the file will become too large.

Then close the book that you want to have closed. The formulas with

then
reference the closed book. Save and close the book with the formula.

Then
overwrite the other book (give the new fiel the same name), and when

you
open up the book with the formulas, they - the formulas - will

automatically
reference the new workbook.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Thanks Bernie. One follow up:

This works fine but only when both documents are open (as you

mentioned).
I
can't seem to figure out how to make it work for when the first
document
is
still closed. To the end users - they will not even know of the

existence
of the first source file.

Once upon a time (8+ years ago at another company), I did this by

entering
a
single formula in cell A1 of the destination file and it

automatically
updated when the file opened. I can't remember what I did and can't
find
any
reference to it so I don't know if I was dreaming or if the support

for
this
was taken away years ago.

Anyway - Thanks again for the response. Any help on getting this to

happen
with the first doc still closed would be great.

--
Glenn


"Bernie Deitrick" deitbe @ consumer dot org wrote in message
...
Glenn,

Open both the workbooks, and run this little macro:

Sub Glenn()
Workbooks("File1.xls").Worksheets("Sheet1").Cells. Copy _
Workbooks("File2.xls").Worksheets("Sheet1").Cells
End Sub

This will, of course, remove any old data or formulas on Sheet1 of

File2,
but won't affect any formulas on other sheets of File1. Those
formulas
should probably be written to look at entire columns, to account for

the
variable lengths.

HTH,
Bernie
MS Excel MVP

"Glenn Mulno" wrote in message
...
Hi All,

Apologies if this has been asked 1000 times already ...

I have two Excel files
file1.xls
file2.xls

File1 gets auto-generated each night and populated with the latest
data.

I wish to create several graphs that use all the data in file1.xls

but
can't
create in file1 as it gets rewritten each night.

Several years ago I believe I did something where I entered a
formula
in
cell A1 of Sheet1 of file2.xls such that it pulled the entire

contents
of
Sheet1 of file1.xls into sheet1 of file2.xls. However - I can not
figure
out how I did this years ago and all the references I have found
looking
around seem to only talk about bringing over only a few cells.

For
example:
http://office.microsoft.com/en-us/as...984241033.aspx

The full range of data in file1.xls is not consistent with each

run
so
I
can
not just hard code a specific range of cells. I just want to pull
in
the
entire sheet from the first file into the second file and have it

be
a
reference that gets refreshed with each opening.

Can anyone offer any suggestions on this? Please let me know if
this
is
not
explained well enough or if I need to provide more details.

Many thanks,

--
Glenn














  #8  
Old January 5th, 2005, 08:55 PM
Bill Manville
external usenet poster
 
Posts: n/a
Default

Glenn Mulno wrote:
I want to pull in an
exact replica of what is in the other sheet - formatting and all.

Edit / Copy
Shift+Edit / Paste Picture Link

if you want to use the content of the pasted cell then also Edit /
Paste but position the picture over the cell.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

  #9  
Old January 5th, 2005, 11:13 PM
Bernie Deitrick
external usenet poster
 
Posts: n/a
Default

YES! Thank you very much! I then wrapped it in the Workbook_Open()
function so that it happens automatically but this appears to work
wonderfully.

Thanks again!


You're welcome - we aim to please....

Bernie


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
linking two sheets in a third sheet Nic Worksheet Functions 2 August 1st, 2004 05:42 PM
Linking Text cell comments to cells on other sheets in same book. Cpl Bowen Worksheet Functions 8 June 2nd, 2004 02:27 AM
Help - Linking sheets and data from Sheet 1 to blank worksheet Bimmy Worksheet Functions 1 March 11th, 2004 06:51 AM
Linking data between sheets A.W.J. Ales Worksheet Functions 2 February 19th, 2004 08:37 PM
linking data from dbase to spec sheets WG Bec Worksheet Functions 0 November 6th, 2003 08:11 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.