+ Reply to Thread
Results 1 to 7 of 7

Automaticaly make an exact copy of a sheet to another sheet in another file.

  1. #1
    Registered User
    Join Date
    04-26-2012
    Location
    Sint-Niklaas, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    4

    Automaticaly make an exact copy of a sheet to another sheet in another file.

    Hi everyone,

    I need some help with the following:

    I have 2 files. I want to have an exact copy of a sheet to another sheet in another file at all time. So when I change the value of a cell, add a line, delete a column etc. in sheet 1 of file 1 it should automatically be copied to sheet 1 in file 2. Is this possible (i think so) and how can this be achieved ?

    Thanks in advance !

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Automaticaly make an exact copy of a sheet to another sheet in another file.

    Hello...
    It would have been a great help if you could upload sample files with your data...
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    04-26-2012
    Location
    Sint-Niklaas, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Automaticaly make an exact copy of a sheet to another sheet in another file.

    OK, I made you an example you can work with.

    I have a workbook Berekeningen.xlsx. On sheet 1 ("Bierprijs") you'll find some data. Some of it are calculated fields.

    When I close this workbook it should copy all data on sheet Bierprijs to the second workbook "Kosten.xlsx" I want it to overwrite ALL data on Sheet1. The data copied should be pasted as values !

    Berekeningen.xlsx
    Kosten.xlsx

    Your help is greately appreciated ! Thanks in advance !

  4. #4
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Automaticaly make an exact copy of a sheet to another sheet in another file.

    Hi
    I have tried to accomplish what you asked for.. When you close the "Berekeningen" file the code will be executed.

    Berekeningen.xlsm

    Kosten.xlsx

  5. #5
    Registered User
    Join Date
    04-26-2012
    Location
    Sint-Niklaas, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Automaticaly make an exact copy of a sheet to another sheet in another file.

    Hi thanks for the help !

    However, when i try your solution and close the workbook "Berekeningen" i get an error message:

    Runtime error '9': Subscript out of range

    When i look up the code, the following is highlighted

    code.jpg

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Automaticaly make an exact copy of a sheet to another sheet in another file.

    Try executing the code before closing the file. Then close it.

    I guess the macro is not finding the source sheet hence you are getting the error.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  7. #7
    Registered User
    Join Date
    04-26-2012
    Location
    Sint-Niklaas, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Automaticaly make an exact copy of a sheet to another sheet in another file.

    Unfortunately that doesn't make any difference...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1