+ Reply to Thread
Results 1 to 2 of 2

Find File

  1. #1
    GWB Direct
    Guest

    Find File

    Can I create a macro that would go to the C: Drive and allow me to pick a
    file and open it. I want to be able to choose the file after I hit the macro
    button.
    --
    Gary Baker

  2. #2
    Nick Hodge
    Guest

    Re: Find File

    Gary

    The code below, throws the standard Open File dialog, allows you to find the
    file, clicking OK captures the name in the variable fName, but does not open
    it. The next line does that, using the name in the variable to identify the
    file to open

    Sub OpenFile()
    Dim fName As String
    fName = Application.GetOpenFilename()
    Workbooks.Open Filename:=fName
    End Sub

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "GWB Direct" <[email protected]> wrote in message
    news:[email protected]...
    > Can I create a macro that would go to the C: Drive and allow me to pick a
    > file and open it. I want to be able to choose the file after I hit the
    > macro
    > button.
    > --
    > Gary Baker




+ 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