Results 1 to 4 of 4

Thread: Macro To Browse Select File And Import Specific Data

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Posts
    193
    Rep Power
    13

    Macro To Browse Select File And Import Specific Data

    I would like a macro to do the following

    1) Open directory C:\Man_Accts so as to allow me to select a csv file that was downloaded (have had to save file as an excel file as site does not allow csv file to be uploaded KBRR_2013022
    2) Once the csv file has been selected (see attached sample), I need the data in columns B:E to be copied from row1 to the destination workbook in sheet TBTXT in Col B:E from row3 onwards-I have copied the data manually into the destination workbook -sheet TBTXT to show you what it should look like after being copied using a macro



    Your assistance in this regard is most appreciated
    Attached Files Attached Files
    Last edited by Howardc; 03-23-2013 at 12:51 AM.

  2. #2
    Member Charles's Avatar
    Join Date
    Aug 2012
    Posts
    63
    Rep Power
    12
    Hi,

    In this attachment you will see a button for test.
    This will produce a Dialog box so you can select the file you want to retrieve the data from.
    I used a filter in the code that will look for duplicates and only set the filter for the Item to be filtered.
    The file you open must have a "Header" row else the code will not filter the data correctly.
    It will copy the filtered range to the worksheet. In your example you have more data than the workbook you are copying from.
    It's the last column in the attached workbook.
    I hope this is close to what you want.
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Posts
    193
    Rep Power
    13
    Hi Charles

    Thanks for all your effort in writing the code-it works perfectly

  4. #4
    Junior Member
    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Additional question to this thread

    Hi

    I'am using your code as well and it is almost doing exactly what I want, but their are some question regarding the code:
    1 - How do change so the listing start on f.eks. row 4 or 5
    2 - How can I add a new sheet for each import. So if I import three different workbooks I will then end up with three sheets. One for each one.
    (I'am planning to have a sheet as an overview where I will get the data from the imported workbooks/sheets)

Similar Threads

  1. Replies: 6
    Last Post: 06-01-2013, 03:24 PM
  2. Select Sheets For Specific Date By Clicking On A Calendar
    By peter renton in forum Excel Help
    Replies: 10
    Last Post: 05-17-2013, 01:57 PM
  3. Replies: 7
    Last Post: 05-08-2013, 07:12 PM
  4. Macro to copy data in specific Columns
    By Howardc in forum Excel Help
    Replies: 0
    Last Post: 04-19-2013, 10:42 AM
  5. Excel VBA Macro To Open A File Through Browse Dialog Box
    By Safal Shrestha in forum Excel Help
    Replies: 2
    Last Post: 04-05-2013, 12:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •