Open a file with a macro

V

Vanity

Hi,

I wonder if it's possible to create a macro that can open a file?
I need a macro-solution for this problem:
For example, if I change something in file1 and then run my macro and
it will open file2 and copy some cells from file1 to file2 and then
close file2 again.
Can someone help me, please?

//Vanity
 
B

Bob Phillips

Set oThis = ActiveWorkbook
Workbooks.Open Filename:="Example.xls"
oThis.Worksheets("Sheet1").Range("A1:H10").Copy ActiveSheet.Range("A1")
ActiveWorkbook.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top