Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the files you want to share the data, you could open them and put in a
formula in one cell ='C:\Myfolder\[exemple1.xls]Sheet1'!A2 and in another cell another formula ='C:\Myfolder\[exemple1.xls]Sheet1'!A3 Do this in each of the workbooks. If you don't want a formula, then you would have to both the source workbook and the destination workbook open at the same time (which you can do in code) so in the source workbook you would have code like Sub UpdateValues() Dim rng1 as Range, bk as Workbook Dim i as Long set rng1 = Thisworkbook.Worksheets(1).Range("A2") for i = 2 to 5 set bk = workbooks.open("C:\myfolder\exemple" & i & ".xls") bk.worksheets(1).Range("A2") = rng1.Value bk.Worksheets(1).Range("A3") = rng1.offset(1,0).Value bk.Close SaveChanges:=True Next End Sub -- Regards, Tom Ogilvy "adinic" wrote: Hello. Is there a way i could update one or several files at once, using data from another excel file? For exemple in file exemple1.xls i have in cells a2 and a3 certain values that i want in files exemple2.xls and exemple3.xls. I would need this for 2 or more files Thank you! -- adinic ------------------------------------------------------------------------ adinic's Profile: http://www.excelforum.com/member.php...o&userid=31529 View this thread: http://www.excelforum.com/showthread...hreadid=533385 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Update Excel Database via Access Main Database with a script | New Users to Excel | |||
Script for Multiple Files | Excel Discussion (Misc queries) | |||
Stand alone VBA script files | Excel Discussion (Misc queries) | |||
Update a workbook from a script | Excel Discussion (Misc queries) | |||
Script or Tool to Update Excel Links | Excel Programming |