+ Reply to Thread
Results 1 to 4 of 4

How to save excel file into REAL plain text

Hybrid View

  1. #1
    Registered User
    Join Date
    08-27-2021
    Location
    Taiwan
    MS-Off Ver
    office 2010
    Posts
    2

    How to save excel file into REAL plain text

    I'm using excel to code HTML. After finish coding, I have to manually select entire worksheet, copy and past into notepad, replace "tab space" to "no space" in order to get the correct result.
    the "sameple.xls" attach file is the partial coding file.
    I had try to save as .txt(with tab), .txt(unicode), .csv and .prn file format. None of them works
    1) the .txt format is adding " " " all over the places
    2) the .csv format is adding " , " all over the places
    3) the .prn format is the closest to the correct result but still has problem with cutting off text content

    Is there any method to save excel file into REAL plain text format?
    Attached Files Attached Files
    Last edited by charleschen6; 08-27-2021 at 02:17 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,993

    Re: How to save excel file into REAL plain text

    Excel is designed for rows and columns. If you want text that is a result of concatenating the columns you need to use VBA to write a plain text file. Here is your file with the macro WriteFile which will write an HTML file using the same name as your file file. It works on whatever sheet is active when the macro is called.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    08-27-2021
    Location
    Taiwan
    MS-Off Ver
    office 2010
    Posts
    2

    Re: How to save excel file into REAL plain text

    First of all, thank you for the fast reply on this thread!!
    The macro you wrote in this file does work. However, there is an extra space betwee each cell content. This extra space needs to remove in order the save file to work.
    I'm not familiar with VBA coding. I'm not able to fix this problem.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,993

    Re: How to save excel file into REAL plain text

    Here is a version without inserting spaces. You may want to spend some time getting familiar with VBA if you are going to use this. This code is pretty simple but you should know how it works in case you ever need to change it.
    Attached Files Attached Files

+ 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. Need Macro to convert html plain report to excel file.
    By monuchengalva in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2020, 11:38 AM
  2. [SOLVED] Assistance in properly pasting plain text into excel
    By starupabove in forum Excel General
    Replies: 3
    Last Post: 04-09-2013, 02:04 AM
  3. Always paste plain text in Excel 2007
    By throwaway12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2012, 08:06 AM
  4. want to convert excel_exe file to plain excel
    By barkat313 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2011, 08:18 AM
  5. Pasting HTML formatted text as plain text in Excel
    By JeffCutter in forum Excel General
    Replies: 1
    Last Post: 09-21-2007, 07:43 AM
  6. Excel considers my formulas as plain text
    By Kimmo Kallio in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-03-2006, 10:40 PM
  7. Import plain text with formulas into Excel
    By schmiedel in forum Excel General
    Replies: 2
    Last Post: 10-13-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