Check Open Workbooks By Part File Name

  • Thanks a lot for that,

    one last tquestion - I dont know If I should start a new thread or not?

    the Data Grabs and pastes perfectly now but the Macro copies the data from the open file - the problem is that every day the filename (eg stats_01_02) changes according to the date so what I want to know is how to have the macro copy the data from an open file using just the first part of the filename.

    Thanks a lot - really appreciate your help

  • Re: Next Available Cell Row

    I'm assuming the common part of the filename is 'stat' here;

    try something like;

    This will search thorugh all the open workbooks and let you select the one you want to copy from by using a messagebox to ask whichis the right one.

    Then just use 'WbkToCopyFrom' as the variable everytime you need to refer to the source workbook.

    Hope that's clear and helps,

  • Re: Next Available Cell Row

    Thanks. It's a structure I use quite a lot when needing to select something from a set that isn't too big.

    It saves having to write a userform with a listbox...

    It can be applied to workbooks, sheets, items within a table, filtering options...anything really where you need to select one / multiple items from a set.

  • Re: Next Available Cell Row

    Sorry to keep bugging you with this!

    below is my code, the macro sees the stats_**_**_**.xls sheet but doesnt copy from it, it just copies from whatever workbook is open (always the one with the start macro button on)

    anyone got any tips?

    (thanks to everyone that has helped so far - you have been great!)

  • Re: Next Available Cell Row

    Corrected code below;


Participate now!

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