ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Link two worksheets.... (https://www.excelbanter.com/excel-programming/372028-link-two-worksheets.html)

J.W. Aldridge

Link two worksheets....
 
Need a code (one that triggers on save).


Whenever a change is saved on THIS sheet (in this workbook):

update the next available row on: another sheet in another workbook.

C:\Documents and
Settings\Administrator\Desktop\[master.request.xls]Sheet1


Is this possible?


Mark Driscol[_2_]

Link two worksheets....
 
When you say a change is "saved" on a sheet what do you mean? Do you
mean when the cell contents are changed? If you mean when the workbook
is saved, you can use the BeforeSave event. Put this code in the
ThisWorkbook module.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
'your code goes here
End Sub


Mark


J.W. Aldridge wrote:
Need a code (one that triggers on save).


Whenever a change is saved on THIS sheet (in this workbook):

update the next available row on: another sheet in another workbook.

C:\Documents and
Settings\Administrator\Desktop\[master.request.xls]Sheet1


Is this possible?



J.W. Aldridge

Link two worksheets....
 

Unfortunately, that's where I need help. ....with the code.
I guess it can be either a change event or as the example above.

Thanx


Mark Driscol[_2_]

Link two worksheets....
 
There is also a Change event for a worksheet.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Copy
Windows("master.request.xls").Activate
Sheets("Sheet1").Select
ActiveSheet.Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
(xlPasteAll)
ThisWorkbook.Activate
End Sub


Mark


J.W. Aldridge wrote:
Unfortunately, that's where I need help. ....with the code.
I guess it can be either a change event or as the example above.

Thanx



J.W. Aldridge

Link two worksheets....
 

THANX!


One question, where do I put the address to the master.request?
It is located in a different location.


B:\S. Drive Backup\[master.request.xls]Sheet3


J.W. Aldridge

Link two worksheets....
 
THANX!

However, could I insert the complete address to the master.request
sheet?

It is stored in a different place.

B:\S. Drive Backup\[master.request.xls]Sheet3

I tried just placing it where master.request is in the code above but
got errors.



Thanx.


Mark Driscol[_2_]

Link two worksheets....
 
When you ask where could you insert the complete address, what are you
intending to do with it? The code I gave you assumes the workbook is
already open. If it is already open, you could use the complete
address to save a copy of the file there. If the file is not already
open, you could use the complete address to open the file. Can you be
more specific about what you intend to do with the complete address?

Mark


J.W. Aldridge wrote:
THANX!

However, could I insert the complete address to the master.request
sheet?

It is stored in a different place.

B:\S. Drive Backup\[master.request.xls]Sheet3

I tried just placing it where master.request is in the code above but
got errors.



Thanx.



J.W. Aldridge

Link two worksheets....
 

THanx again,

The workbook will not be open at the time of update.
I tried placing the address in the code above (with the complete
directive address) and i got an error.
I think this just may be a directive problem when including the entire
address/directive vs. the sheet name. ( quotation mark vs. carrot).

Thanx



All times are GMT +1. The time now is 11:30 PM.

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