Take File Name From Macro

  • can some please tell me how to send the file name i get from the code below to a cell.

    Code
    Sub TestGetOpenFile()
         
        Dim selectfile         As Variant
        Dim item                As Variant
        selectfile = Application.getopenfilename(MultiSelect:=True)
        For Each item In selectfile
            MsgBox item
        Next item
         
    End Sub
  • Re: Take File Name From Macro


    Hello, zotee98!


    Perhaps something like:


    Code
    Range("A1").Value = Application.GetOpenFilename(MultiSelect:=True)



    Mac

Participate now!

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