+ Reply to Thread
Results 1 to 4 of 4

User Selects File- That file is copied to a sheet

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Question User Selects File- That file is copied to a sheet

    Hi all,

    I'm trying to accomplish something that I can't seem to figure out in VBA. It's a little hard for me to explain, but I will try my best.

    What I want to do is prompt the user with a Windows Explorer window to browse for a file. The file that the user navigates to will be a workbook that I am going to copy from.

    I've been able to create an Explorer window like this:

    Shell("explorer.exe ", vbNormalFocus)

    This allows the user to browse for and open a file. But what I want is for that file to be my source for copying.

    I have no idea how to get the 'result', or to get a specific file to work with after they have navigated to it, since the return value here seems to just be a success or failure value.


    The goal here is for the user to be able to select an outside file that will have certain elements copied into another worksheet- instead of just opening it.

    The files that are being navigated to, that I am trying to copy from, are .csv files if that matters.
    Last edited by FancyCorndog; 08-09-2012 at 07:11 PM.

  2. #2
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: User Selects File- That file is copied to a sheet

    Hi... this may help (it allows multiple sheets to be opened and copied/pasted/closed)

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: User Selects File- That file is copied to a sheet

    This does look like it will be helpful, will take a look at it when I get back. Thank you so much!

  4. #4
    Registered User
    Join Date
    08-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: User Selects File- That file is copied to a sheet

    So I've got something going here, but for some reason the data is being placed into the first sheet in my (destination) workbook instead of in the last sheet.

    Please Login or Register  to view this content.
    What silly mistake am I making here? It's actually working pretty well, except for putting the data into the first sheet instead of the last sheet.

    edit: looks like I needed to specify ThisWorkbook.Sheets.Count - 1
    Last edited by FancyCorndog; 08-09-2012 at 07:11 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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