Results 1 to 2 of 2

file browser window

Threaded View

  1. #1
    Registered User
    Join Date
    02-09-2004
    Posts
    52

    how to open a file browser as part of excel macro?

    Hi,

    I was wondernig if anyone could help me...

    I have a macro which was written a while ago with some assitance from a member of excelforum.

    Basically it looks in one directory, and copies the files listed in column A to anther directory. The code is below.

    I'm looking now to expand this macro so that when I click the button "copy files", a file browser window would open so that I can select the relevant directory rather than changing it in script everytime I want to look at a different folder. Ideally I'd have the same thing for the copy destination.

    If anyone could help it would be great, even to point me in the right direction for getting vb to open a file browser.

    macro:

    Sub copy_files()
    Dim rng As Range
    Dim cell As Range
    Dim SrcFilename As String
    Dim DestFilename As String

    Set rng = Selection
    For Each cell In rng
    SrcFilename = "\\network_location\" & cell.Value 'change source path
    DestFilename = "\\network_location\" & cell.Value 'change destination Path
    FileCopy SrcFilename, DestFilename
    Next
    End Sub



    Many thanks,

    Mark.
    Last edited by saybut; 08-15-2005 at 12:20 PM. Reason: no repsonse, trying better title

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