Two workbooks - Find matching cell value on another workbook, then copy paste cell info into same row of other workbook in specified collum

  • Hi Roy,


    please find below the your original VBA with amendments that reflect my needs. Collum Q of the master workbook just has standard cells in it.

    After populating the relevent cells and the search and find workbook, when i run the macro it does not open up the master workbook automatically. Instead it open up the standard explorer box and I have got to navigate to the master workbook file and open it manually. After that point everything is automated. VBA Below


  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags

    Note: no apostrophe in the tags, just used for demonstration here.

    ['code]


    your code goes between these tags


    ['/code]


    Or, just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.

  • So how does Excel know which workbook to open?

    Hi Roy,


    Your VBA works great but it opens up explorer when i run the macro, and I need to point to the file and click to open it. As soon as i click to open the VBA does it's job as should. However i wish for the macro to auto open the master tracker.


    I have another bit of VBA below that I use to populate all of the cells but collum Q of the same workbook (master tracker) and sheet in question which works perfectly that opens and closes the master Tracker workbook automatically as should.


  • Will you read the Forum Rules and please use Code Tags.


    Your other code works because you tell it which workbook to open


    Code
    Set wbMaster = Workbooks.Open("\\DFW03018\Data_DFZ70069\199711009\workgroup\DATA_MAN\shared\RAR Launcher\Master Tracker.xlsm")
  • So how does Excel know which workbook to open?

    And this is the VBA that you have created for me, not sure if you can compare. As to why your VBA is not automatically opening the master tracker.


  • Try this


  • Try this


    Hi Roy,


    I have a run time error '1004':


    and within the VBA this is highlighted yellow:- Set oWb = Workbooks.Open(sFilePath)


    Regards,


    Lee

  • Try this


    Hi Roy,


    your original VBA code worked as should but opened up the explorer box in which I had to click on the database file to help it on its way.

    The latest VBA code doesn’t work at all and throws up an error.

  • I missed a line of code.


    There's no need to keep quoting previous replies

  • It's working Roy, apart from now I am getting a popup saying Master Tracker is already open, do you want to re-open it?

    Just to note, the Master Tracker is closed I think maybe the VBA is trying to open it twice?

    Here is the script below.


  • Please us Code Tags when posting code on the Forum.


    It was attempting to open the workbook twice, try this


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!