+ Reply to Thread
Results 1 to 3 of 3

Save sheet as tab delimited text file issue

  1. #1
    Registered User
    Join Date
    10-10-2003
    Location
    Massachusetts
    Posts
    35

    Save sheet as tab delimited text file issue

    Here is a simple example of the sheet layout. Three rows and at most 5 columns with data.

    A B C
    D E F G
    H I J K L


    We save the sheet into a tab delimited text file.
    The text file ends up as 5 columns by 3.
    The problem is when we go to upload the tab delimited text file to the receiving authority.
    We get an error pertaining to the number of columns in rows 1 and 2.
    The first row has data in 3 columns. However the tab delimited text file has tabs for the "empty" 4th and 5th column of row 1.
    The second row has data in 4 columns and an extra tab for the "empty" 5th column.
    All the rows after row 3 have data in all 5 columns.
    We can manually delete the tabs from the text file, and all is good with the upload.
    Obviously, we would like to avoid the need to manually edit the text file.

    The only way we have been able to think of to accomplish what we want is to split the information onto 3 sheets. One sheet with row 1 that has only 3 columns, sheet2 with row 2 that has 4 columns, and a 3rd sheet that has all the rest of the rows that have 5 columns. Then save 3 text files. Then copy the 3 files into one file. Obviously a kludge at best. Never mind we are clueless at how to run a dos command prompt using variables from within Excel VBA.

    Here's an example of something that on the surface should be simple, but in practice is an issue.

    As always, any ideas are greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    2010
    Posts
    2,145

    Re: Save sheet as tab delimited text file issue

    If you save the workbook as xlsm and want the worksheet to be exported as you wish this will give it the same name as the master sheet, with the txt extension

    Please Login or Register  to view this content.
    hopefully a start you can adapt as required

  3. #3
    Registered User
    Join Date
    10-10-2003
    Location
    Massachusetts
    Posts
    35

    Re: Save sheet as tab delimited text file issue

    AWESOME!!!!!!!!!!!!! Thank you!!!! I never would have known how to do it.

+ 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 save sheet as tab delimited file.
    By San75 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2016, 02:39 PM
  2. Script/macro to save a copy as tab delimited text file and then close original file
    By Merlin803 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2015, 01:34 PM
  3. VBA to Save a Single Sheet as a Tab Delimited Text File
    By mattmc419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2014, 03:34 PM
  4. save as pipe delimited text file.
    By aryam in forum Excel General
    Replies: 2
    Last Post: 04-13-2011, 11:14 AM
  5. Save as a pipe delimited text file
    By Jetheat in forum Excel General
    Replies: 5
    Last Post: 07-01-2010, 08:07 AM
  6. Replies: 1
    Last Post: 05-03-2005, 06: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