+ Reply to Thread
Results 1 to 4 of 4

Button to allow user to browse, select and import CSV file

  1. #1
    Registered User
    Join Date
    05-04-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    4

    Button to allow user to browse, select and import CSV file

    Hello forum,
    I have a question i hope some of you might be able to help me with.

    I have a document where i would like to import a CSV file.
    I would like to be able to push a button "Import CSV" and get a browse window where i can locate the file i want to import and then import it.

    I made a recording of a macro where i use the import CSV function and then adjusts the rows/colums and was hoping to use this after the file is selected.

    The macro inserts the csv in to the excel, deletes an column that empty, removes the 4 first lines in the csv file and renames the column title.

    Please Login or Register  to view this content.
    Im not locked in to this solution. If you know of a better way where i can click a button, get a browse window to select my file and import the contens in to my worksheet im all ears :-) the CSV file differs in rows. one fil might have 4000 rows another might have 15000 rows but the 12 columns will always be the same.

    Best regards
    Joachim

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Button to allow user to browse, select and import CSV file

    Hi there,

    I'm not too familiar with the approach you're using, but see if the following (totally different) approach get you moving in the right direction:

    Please Login or Register  to view this content.
    The highlighted values may be changed to suit your requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    05-04-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    4

    Re: Button to allow user to browse, select and import CSV file

    Hi Greg, sorry for the delayed reply.
    I likte the setup. Very clean. but i get an error #I/T in the last two columns.

    Got any idea why?

    I will try to investigate more, liked you apporach.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Button to allow user to browse, select and import CSV file

    Hi again,

    I'm not sure exactly what you mean when you say:

    but i get an error #I/T in the last two columns

    Is there any chance you could post a small sample of your raw data and of the processed data so that I can understand your situation better?

    Regards,

    Greg M

+ 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. [SOLVED] Browse to file (DAT) & Import fixed column widths
    By Webbers in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-02-2019, 12:59 PM
  2. Browse to htm file and import
    By webwyzard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2018, 08:22 AM
  3. [SOLVED] Macro to import .csv from browse for file location dialog box.
    By gutterball in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2014, 08:30 AM
  4. Browse and import .csv file into new tab
    By alf40 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2013, 11:22 PM
  5. Prompt user to select file to import
    By Lmsloman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2009, 07:23 PM
  6. how to write coding can make the browse button can select multiple choices
    By ccs_1981 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2008, 01:37 PM
  7. Browse button to select and display the file path
    By sowetoddid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2005, 05:05 PM

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