Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a spreadsheet that is my main working spreadsheet but I need the same
date to be displayed in another workbook. How can I update the working spreadsheet so as to have the same inforamtion updated in antoher workbook. Curently I am updating both spreadsheets but would like to be able to only update the working copy and it have the other one updated at the same time. Is this possible, if so would appreicate the assistance. Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
what you could do is to have a list of workbooks in your "data workbook"
then run a macro at closing the workbook: go into the visual basic workbook of your data-workbook. double click on "this workbook" change to "workbook" in the topline at the left of this sheet and at the right of the sheet choose BeforeClose then put this macro in: Private Sub Workbook_BeforeClose(Cancel As Boolean) 'this macro will look for workbook names in the first column 'of sheet "MyWorkbooks", opens that workbook, updates it and closes it 'this macro will auto run before the workbook is closed and is activated 'as soon as you close the data-workbook ' Dim LastCell As Integer, I As Integer Sheet("MyWorkbooks").Select For I = 1 To LastCell If Cells(LastCell, 1) < "" Then Workbooks.Open (Cells(LastCell, 1)) ActiveWorkbook.UpdateLink 'updates all links in the active Workbook ActiveWorkbook.Close 'if you have links in between the workbooks, you better put the 'CLOSE command after the NEXT command! Else Exit Sub End If Next I End Sub it only (auto)runs in the main workbook, marked in the Project overview as an excelsheet. good luck! "yukon_phil" wrote: I have a spreadsheet that is my main working spreadsheet but I need the same date to be displayed in another workbook. How can I update the working spreadsheet so as to have the same inforamtion updated in antoher workbook. Curently I am updating both spreadsheets but would like to be able to only update the working copy and it have the other one updated at the same time. Is this possible, if so would appreicate the assistance. Thanks |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You have lost me, sorry not familiar with Visual basic. Where do I go? The
name of the Data workbook is "Tangible Capital Assets" and there are a number of sheets in that work book. The other workbook I want updated is called "2007-08 Capital Submission" and the worksheet in that book I want updated is called "Cap 11 -Tangible Capital Assets" Does this help in you helping me iwth my dilemma? Thanks "WJvanRooijen" wrote: what you could do is to have a list of workbooks in your "data workbook" then run a macro at closing the workbook: go into the visual basic workbook of your data-workbook. double click on "this workbook" change to "workbook" in the topline at the left of this sheet and at the right of the sheet choose BeforeClose then put this macro in: Private Sub Workbook_BeforeClose(Cancel As Boolean) 'this macro will look for workbook names in the first column 'of sheet "MyWorkbooks", opens that workbook, updates it and closes it 'this macro will auto run before the workbook is closed and is activated 'as soon as you close the data-workbook ' Dim LastCell As Integer, I As Integer Sheet("MyWorkbooks").Select For I = 1 To LastCell If Cells(LastCell, 1) < "" Then Workbooks.Open (Cells(LastCell, 1)) ActiveWorkbook.UpdateLink 'updates all links in the active Workbook ActiveWorkbook.Close 'if you have links in between the workbooks, you better put the 'CLOSE command after the NEXT command! Else Exit Sub End If Next I End Sub it only (auto)runs in the main workbook, marked in the Project overview as an excelsheet. good luck! "yukon_phil" wrote: I have a spreadsheet that is my main working spreadsheet but I need the same date to be displayed in another workbook. How can I update the working spreadsheet so as to have the same inforamtion updated in antoher workbook. Curently I am updating both spreadsheets but would like to be able to only update the working copy and it have the other one updated at the same time. Is this possible, if so would appreicate the assistance. Thanks |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
of course you need to give LastCell a value before the for...next -loop! :-)
I forgot, sorry. WJvR "yukon_phil" wrote: I have a spreadsheet that is my main working spreadsheet but I need the same date to be displayed in another workbook. How can I update the working spreadsheet so as to have the same inforamtion updated in antoher workbook. Curently I am updating both spreadsheets but would like to be able to only update the working copy and it have the other one updated at the same time. Is this possible, if so would appreicate the assistance. Thanks |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I played a bit with it my self this time and found some problems. here is a
working one: Private Sub Workbook_BeforeClose(Cancel As Boolean) 'this macro will look for workbook names in the first column 'of sheet "MyWorkbooks", opens that workbook, updates it and closes it 'this macro will auto run before the workbook is closed and is activated 'as soon as you close the data-workbook 'the names of the worksheets that you want to update must have the full path 'like this: E:\Tables\testfiles\myFile_01.xls 'the first worksheet starts in cell A1 'in this example the last worksheet is in cell A10 (LastCell=10) ' WJvR 20060901 ' Dim LastCell As Integer, I As Integer LastCell = 10 Sheets("MyWorkbooks").Select For I = 1 To LastCell If Cells(I, 1) < "" Then Workbooks.Open (Cells(I, 1)) ActiveWorkbook.RefreshAll 'updates all links in the active Workbook 'if you have links in between the workbooks, you better put the 'CLOSE command after the NEXT command! Else Exit Sub End If Next I ActiveWorkbook.Close savechanges:=True End Sub 'before close Good luck again! WJvanRooijen "WJvanRooijen" wrote: of course you need to give LastCell a value before the for...next -loop! :-) I forgot, sorry. WJvR "yukon_phil" wrote: I have a spreadsheet that is my main working spreadsheet but I need the same date to be displayed in another workbook. How can I update the working spreadsheet so as to have the same inforamtion updated in antoher workbook. Curently I am updating both spreadsheets but would like to be able to only update the working copy and it have the other one updated at the same time. Is this possible, if so would appreicate the assistance. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Referencing data on multiple worksheets | Excel Worksheet Functions | |||
Data referencing and auto fill across worksheets in one workbook.. | Excel Worksheet Functions | |||
referencing same cell in several worksheets | Excel Discussion (Misc queries) | |||
Double-click referencing to other worksheets | Excel Discussion (Misc queries) | |||
Referencing cells in different worksheets | Excel Worksheet Functions |