+ Reply to Thread
Results 1 to 2 of 2

VBA Button to have use choose a file & copy the contents

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    gemestio are
    MS-Off Ver
    Excel 2010
    Posts
    53

    VBA Button to have use choose a file & copy the contents

    Gentlemen,

    I am trying to create a control form in VBA and one of the things i need there is to have a button that allows the user to choose the file to be imported.

    The imported file should have a "Sheet1" and the contents of this sheet should be copied into the "Sheet1" of the existing file (attached).

    I've been using the code below but to no avail - i get an error every time i try to import something. Could you help, please?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Fotis1991; 09-12-2013 at 01:29 PM. Reason: added code tags

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VBA Button to have use choose a file & copy the contents

    Hello to you.

    Pls

    Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here


    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. How can I open a file with a vba script and copy the contents out?
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2013, 02:11 AM
  2. Copy and paste cell contents using a button
    By bjscuba135 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2012, 09:44 AM
  3. [SOLVED] Allow user to open a file and copy the contents?
    By man123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2012, 12:13 PM
  4. Open File, Choose sheets to copy, close
    By jram in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-17-2010, 03:23 PM
  5. Copy cell contents to Button Label?
    By Dean England in forum Excel General
    Replies: 5
    Last Post: 04-22-2007, 09:37 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