Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Referencing worksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Referencing worksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Referencing worksheets

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Referencing worksheets

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Referencing worksheets

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Referencing worksheets

ok, you need to open the visual basic editor.
send me an empty email to my address:


I will reply on that with my example for you!

Wim-Jan van Rooijen

"yukon_phil" wrote:

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

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
Formula Referencing data on multiple worksheets ChrisPrather Excel Worksheet Functions 6 August 22nd 06 05:14 AM
Data referencing and auto fill across worksheets in one workbook.. Corey Helms Excel Worksheet Functions 0 July 17th 06 03:44 PM
referencing same cell in several worksheets coriolis Excel Discussion (Misc queries) 2 May 20th 06 12:51 AM
Double-click referencing to other worksheets apubapu82 Excel Discussion (Misc queries) 2 April 5th 06 11:38 PM
Referencing cells in different worksheets DiiRK Excel Worksheet Functions 1 November 14th 05 07:34 PM


All times are GMT +1. The time now is 11:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"