+ Reply to Thread
Results 1 to 10 of 10

Macro/VBA to automatically update one workbook from another separate workbook

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Macro/VBA to automatically update one workbook from another separate workbook

    Hi friends,

    I'm quite the Excel noob but I'm working on a project that has 2 separate workbooks. One workbook is the project register, which has a list of all the projects the company has worked on by country name as well as project name and city name within that country. The second workbook is a cost database which is almost identical to the register, in that it has the country name, project name and city in the same order as the project register. The cost database also contains hyperlinks to different folders on the network with cost information specific to the country. Some cells in the database contain more than one hyperlink. I placed each hyperlink in textboxes so the row numbers in the database would correspond to those in the register. I'm trying to write a macro right such that there is a command button i placed in the register workbook called "Update". Basically what I would like to happen is that when a new row is inserted in the register (could be at the end or in between information since the register is alphabetical so if a new project comes up in a country starting with let's say H, when I insert a new row under for example row 25 in the H section in the register, a new row will appear in the database under row 25 in the H section), and the "Update" button is clicked, a new row would be inserted in the database workbook at the exact same location. It would be great if the information entered in the register workbook in the new row(s) would be updated in the database workbook too, but if that is too much, I just need the rows, so at least we can keep up with the new information in the database and will not have to go back to the register some time in the future and manually mass update it with all the new projects entered. Am I making sense? I literally have never coded a macro before, i don't know the language or syntax at all. ANY help would be appreciated. i tried fighting to write a piece of code but as expected it isn't working. I can post it also if that is necessary. Sorry this is so long!

    Thanks!
    Reesha

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

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    Do you have some sample files containing dummy data that you can upload? Ensure that the layout matches the original file.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    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]

  3. #3
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    Ok I've attached a dummy register workbook. ignore the book 1
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    and here is the database dummy file with the hyperlinks
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    any ideas anybody?

  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: Macro/VBA to automatically update one workbook from another separate workbook

    Please do not bump so fast. You need to wait atleast 12 hrs before you bump.

  7. #7
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    I'm sorry. Apologies. :s

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

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    Any reason why you are updating 2 workbooks? You can work with one workbook itself, right?

  9. #9
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    The register was created before the database and is already populated with information. The idea of linking the two together came only after the database had already been created and hyperlinks inserted. I know it would be SO much easier if they were in one workbook, that way I could just group the worksheets together and so when I insert a new row into the register when a new project comes up, it would automatically insert in the same location in the database, but my hands are tied. I have two separate workbooks that need to be linked somehow and I don't know how :/

  10. #10
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    Is it okay if bump now? No ideas anybody?

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

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    What i meant to ask you is - why not stick to one file itself? Why 2 separate files or even 2 separate sheets? Why not do a one-time update of files to keep the most up to date information in one file and then discontinue the other file?

  12. #12
    Registered User
    Join Date
    03-11-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Macro/VBA to automatically update one workbook from another separate workbook

    Because I think they wanted just the register list separate from the cost database information. Plus the cost database information won't be updated as regularly as the register list. But they didn't want someone to have to go back in after 3 months and compare the register with the database and update the database from there. That's why I was asking if there was any way to sort of group the two workbooks so that when the register is updated with new project information, the cost database will also be updated with project information. That way when it becomes time to update the database with cost information, the project information would already be there so all the person would need to do is follow the project information to the respective folders on the system and find cost information and put it into the database. Am i making sense?

+ 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