+ Reply to Thread
Results 1 to 3 of 3

Import data from text file to excel workbook

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    11

    Import data from text file to excel workbook

    I have a text file containing multiple rows of data and I want to copy it all and paste it into an open workbook (without performing any formatting like text to columns). Is there an easy way to do this via vba? The text file will always be on my desktop and have the same name but the workbook name will change from month to month.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Import data from text file to excel workbook

    You don't want to use Text to Columns. Is there any structure to your text file? How are data on the same line in the text file supposed to be split into multiple columns?

    In general, yes, VBA could import your text file. If you'd always be importing the text file into the active workbook, the VBA macro could refer to ActiveWorkbook and not need to know the workbook's filename or drive/directory path. And that's as much of an answer as I can give without more details from you.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Quote Originally Posted by cjl22 View Post
    Is there an easy way to do this via vba?
    From the top tab Data : Import From File …

+ 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. Import text file to a new excel workbook
    By chandrup23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2016, 11:11 AM
  2. export/import excel data to/from text file
    By Axmed.cm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2016, 09:25 AM
  3. import data from text file into Excel (ADO)
    By Andrew1983PL in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2013, 08:10 AM
  4. VBA Request - Import Data from Text File to Excel
    By spiwere in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-12-2013, 01:44 AM
  5. Import text file data into excel
    By arvin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2011, 09:17 PM
  6. Import data from text file to excel
    By copythat in forum Excel General
    Replies: 7
    Last Post: 11-17-2011, 10:19 AM
  7. Import Excel Data from another workbook or file
    By tamato43 in forum Excel General
    Replies: 1
    Last Post: 02-28-2005, 02:06 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