+ Reply to Thread
Results 1 to 6 of 6

File dialog box to open a excel file then copy data close file

  1. #1
    Registered User
    Join Date
    02-10-2018
    Location
    toronto ontario
    MS-Off Ver
    office 2010
    Posts
    66

    File dialog box to open a excel file then copy data close file

    Hi Everyone
    I trying to edit the following code so I open a file dialog box point to the excel file I need then copy the range I have to the work book I am working in

    Any help Please and Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: File dialog box to open a excel file then copy data close file

    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 06-22-2019 at 04:27 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    02-10-2018
    Location
    toronto ontario
    MS-Off Ver
    office 2010
    Posts
    66

    Re: File dialog box to open a excel file then copy data close file

    this close but the file name maynot be master orha 2018 it may be called something else I need to be able to point to the fi;le then copy the B5 range

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: File dialog box to open a excel file then copy data close file

    Then substitute the file name you want for 'ThisWorkbook'
    Please Login or Register  to view this content.
    Just make sure the workbook is open when you do it that way. Otherwise you might need to use both the path and file name to open the workbook in the same fashion as the one using the wb variable. You need to be clear about what you are looking for in the original post, to avoid these secondary conversations.
    Last edited by JLGWhiz; 06-22-2019 at 10:50 PM.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: File dialog box to open a excel file then copy data close file

    From which sheet do you want to copy the data?
    And which sheet do you want to paste into?
    The way you have it now will just point to whichever sheet was the active sheet when saved previously and the sheet that happens to be active in the workbook you want to paste into.

    Dave's Excel has the below code.
    Should be easy to change to your requirements.
    Please Login or Register  to view this content.
    Last edited by jolivanes; 06-22-2019 at 11:52 PM.

  6. #6
    Registered User
    Join Date
    02-10-2018
    Location
    toronto ontario
    MS-Off Ver
    office 2010
    Posts
    66

    Re: File dialog box to open a excel file then copy data close file

    I would like to copy the info from the file get open filename to the active work sheet that I have open (Membership)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problem With Open File and Save File With Saveas and then close the File
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2013, 12:53 AM
  2. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  3. [SOLVED] VB to open a file, input on a file and close again, with NO macros/vb saved to file
    By unreal_event_horizon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2012, 11:41 AM
  4. [SOLVED] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  5. VBA for excel 2003. Open file dialog box, open 2007 file xlsx, continue with code
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2011, 12:12 AM
  6. How to: Open file, format data, save file, close file and repeat.
    By thexeber in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2010, 12:56 PM
  7. open file dialog, copy data
    By H_pok in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2005, 11:51 AM

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