+ Reply to Thread
Results 1 to 3 of 3

Import delimited text files as new sheets in current workbook.

  1. #1
    Registered User
    Join Date
    08-27-2019
    Location
    Alabama, USA
    MS-Off Ver
    365, 2016, 2010, 2007
    Posts
    57

    Import delimited text files as new sheets in current workbook.

    Hello forum, I need help on something I can't figure out.

    I have some *working* code that will open multiple specialized textfiles, delimited, as consecutive sheets in a NEW workbook. I need to make it open them as consecutive sheets within a workbook specified within a variable (variable currently being defined as active workbook, but have the flexibility to change that if needed as my spreadsheet/program grows). It feels like it should be a simple problem, but everything I try either gives me an error, or some unintended side effects (such as inserting two blank columns in the middle of the delimited data).

    The following is the subroutine that opens them in a new file:
    Please Login or Register  to view this content.
    Any suggestions are appreciated, thanks ahead of time.

    p.s. I've tried to understand line 19 of that code (that I found on the internet and, with the help of this forum, changed to make work in my situation) and am unsure if I'm correct. I've searched a bit and it *might* be better interpreted as (-1 or 0) instead of (1 or 0) -which of course are not equal to the filename- ...but I can't find anything concrete, and although getting this spreadsheet/program working is the current short term goal, I really want to learn in the process so that I am better equipped to do this again when the need arises. Is my comment in the following snippit a good representation of what is happening?

    Please Login or Register  to view this content.
    p.p.s. I have also posted this problem on mrexcel at the following link https://www.mrexcel.com/forum/excel-...-workbook.html

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Import delimited text files as new sheets in current workbook.

    Try this (not tested)

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-27-2019
    Location
    Alabama, USA
    MS-Off Ver
    365, 2016, 2010, 2007
    Posts
    57

    Re: Import delimited text files as new sheets in current workbook.

    Thank you AlphaFrog, this worked exactly as intended! Thank you so much, you have no idea how long I've been fighting with this one :// It may have seemed obvious or simple to you, but I'm still learning and it was a tough one for me.

    Best regards,
    Trent S - KM4YTU


    [SOLVED]

+ 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. Macro to import multiple delimited text files to one Excel sheet
    By Olai in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2018, 04:00 PM
  2. Import text files to current workbook
    By vegaman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2015, 04:29 PM
  3. Import Multiple Text Files into Single Workbook with Different Sheets
    By oliver.marshall001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2014, 09:29 AM
  4. Import multiple csv files into current workbook as separate sheets
    By santosh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-31-2013, 04:19 AM
  5. import tab delimited text files into excel but skip first 5 lines
    By alexbotea2005 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-28-2011, 05:22 PM
  6. How do I import/convert tab delimited text files into Excel?
    By jim in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-03-2005, 06:06 PM
  7. [SOLVED] Best way to import fixed-width delimited text files into an array?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2005, 11:06 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