Have User Browse For File To Copy Sheets

  • One of my wireless carriers provides commission data in Excel, each of their downloads has a specific name which refers a month’s commissions. I’ve thought about making a copy of each month’s Workbook when it is available with the name “current download.xls” and then work with it in a know directory.


    I’ve just recently discovered InputBox and am wondering if I can use it to ask the user to find (Browse for) the actual file they want, thus saving the step of creating and renaming a copy of the actual file.


    Since I like to work with the files as does another Director of my company, and the actual workings are handled on another management level I do not want to point to a specific directory.


    I’m thinking there is a way to copy the needed sheets without opening the file but I can save that for another question. First things first...thanks


    Here is some code I recorded then tweaked a little, sorry if it isn’t elegant…



    thanks for any suggestions

  • Re: Have User Browse For File To Copy Sheets


    Charles,


    If I understand your question, check out the GetOpenFileName method. It opens a file browser, and returns the name of the selected file, which you can then open. Please post back if you have problems.


    Regards,

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

  • Re: Have User Browse For File To Copy Sheets


    Hey! Thanks!
    That was too easy.
    I did a search but instead of searching for "inputbox" this time I searched for "getopenfilename" and here is what I found...


    Code
    Sub getopenfilename()
        Application.Dialogs(xlDialogFindFile).Show
        
    End Sub


    If you could see me now, you would see me smiling ear to ear.:p

Participate now!

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