Results 1 to 5 of 5

Thread: Import data from csv with open Dialogue box

  1. #1

    Import data from csv with open Dialogue box



    Register for a FREE account, and/
    or Log in to avoid these ads!

    hello all..

    i need some help in excel vba.. i want to import data in my excel sheet which is in 4 .csv files..

    i want to do this with a command button_click command... with open dialogue box then select range where to import data. the csv file contains 5 columns and i need 4 (abcd)..

    can anybody help me out?

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,087
    Articles
    79
    Blog Entries
    14
    Yes, but we'll need more info.

    Do you want to browse to locate the file?
    Will you always be only importing the first 4 columns?
    Where do you want to put that data? And exisiting worksheet, new worksheet...?

    Give us as much info as you can on what you'd like to do.
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    Thanks for your reply Ken... yes here's the info.

    yah i want to locate the file, and i need 4 column always... and i need the data in existing worksheet..

    actually the data is something like that...

    column A - Name, column B - MSISDN, column C - Dated, and column D - Remarks

    now i want to import first 3 columns (A, B and C) then left 2 columns blank (D and E) and then import the 4th column (column D in CSV) to Column F in my worksheet.. hope you understand

    thanking you

  4. #4
    No Replies please can anybody help me ?

  5. #5
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,087
    Articles
    79
    Blog Entries
    14
    Sorry Arshmaan, I missed your post while working on other things.

    Can you start by recording a macro going through your import/copy steps, then post the code here? I'll edit the code to make it more efficient/dynamic, and put in the ability to browse to a different file.
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

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