LInking workbooks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a database set up which is very similar to another database which is
used. Some of the questions are the same in both databases. Is there any way
of transferring the data so to save time on typing? Also, The databases are
shared by many and are updated frequently. Can i program excel to start on
the next available free row when transferring data across?

Hope you can help,

Regards.
 
This is a simple example that you can adapt:
1. assume there are two open workbooks:
sourse.xls
destinaton.xls

2. assume the sheet name is:
s1
on both workbooks

3. assume column A is always filled in

The user (working in sourse.xls) completes entries, selects the rows to be
copied,
and runs this macro:

Sub cary_across()
Workbooks("sourse.xls").Activate
Sheets("s1").Activate
Set r1 = Selection

Workbooks("destinaton.xls").Activate
Sheets("s1").Activate
n = Cells(Rows.Count, "A").End(xlUp).Row + 1
Set r2 = Cells(n, "A")

r1.Copy r2
End Sub
 
Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Are you quite certain? In this context, I mean to use the ALT key like a
SHIFT key. So first press the ALT key and while it is still pressed, touch
the F11 key
 
Yes, this short cut definitely doesn't work.

Gary''s Student said:
Are you quite certain? In this context, I mean to use the ALT key like a
SHIFT key. So first press the ALT key and while it is still pressed, touch
the F11 key
 
Back
Top