ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Importing a single cell from one .xls to another (https://www.excelbanter.com/excel-programming/411757-importing-single-cell-one-xls-another.html)

AMaleThing

Importing a single cell from one .xls to another
 
I'm hoping you can help me find a simple method to a problem.

I was importing a .xls file using the External Data tool into my
worksheet which worked find.

I now have a requirement to import data from reports generated each
day, so importing the whole of a sheet each day might not be the
simpliest method.

Is it possible to enter a single value from an .xls file:
e.g.: ='C:\...\desktop\[test.xls]Sheet1'!A1 //output e.g. 22

Mike H

Importing a single cell from one .xls to another
 
Hi,

You could try a couple of ways.
1. Copy the cell in your source workbook (Edit - Copy) then select the cell
in the recieving workbook and then
Edit|Paste Special|Paste Link

or

Try this small macro in the recieving workbook.

Sub getdata()
Workbooks.Open Filename:="c:\book2.xls" 'source book change to suit
myvalue = Sheets("sheet1").Range("A1").Value
ActiveWorkbook.Close savechanges:=False
ThisWorkbook.Worksheets("Sheet1").Range("B1").Valu e = myvalue
End Sub

Mike

"AMaleThing" wrote:

I'm hoping you can help me find a simple method to a problem.

I was importing a .xls file using the External Data tool into my
worksheet which worked find.

I now have a requirement to import data from reports generated each
day, so importing the whole of a sheet each day might not be the
simpliest method.

Is it possible to enter a single value from an .xls file:
e.g.: ='C:\...\desktop\[test.xls]Sheet1'!A1 //output e.g. 22


AMaleThing

Importing a single cell from one .xls to another
 
On 30 May, 11:46, Mike H wrote:
Hi,

You could try *a couple of ways.
1. Copy the cell in your source workbook (Edit - Copy) then select the cell
in the recieving workbook and then
Edit|Paste Special|Paste Link

or

Try this small macro in the recieving workbook.

Sub getdata()
Workbooks.Open Filename:="c:\book2.xls" 'source book change to suit
myvalue = Sheets("sheet1").Range("A1").Value
ActiveWorkbook.Close savechanges:=False
ThisWorkbook.Worksheets("Sheet1").Range("B1").Valu e = myvalue
End Sub

Mike



"AMaleThing" wrote:
I'm hoping you can help me find a simple method to a problem.


I was importing a .xls file using the External Data tool into my
worksheet which worked find.


I now have a requirement to import data from reports generated each
day, so importing the whole of a sheet each day might not be the
simpliest method.


Is it possible to enter a single value from an .xls file:
e.g.: ='C:\...\desktop\[test.xls]Sheet1'!A1 * *//output e.g. 22- Hide quoted text -


- Show quoted text -


Thanks for the help. I went with the first suggestion as it was the
simplest, however I'll keep hold of your other suggest becuase I've a
feeling this is getting mor complicated that expected.

Thanks again!


All times are GMT +1. The time now is 03:16 AM.

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