+ Reply to Thread
Results 1 to 2 of 2

Save a range of sheets to TEXt file

  1. #1
    Registered User
    Join Date
    10-15-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Exclamation Save a range of sheets to TEXt file

    Hi,

    For the last few days I have been trying to solve this issue but with no success so I desperately need help.
    My XLS file contains several sheets each having different number of rows and columns. I want to create macro that will export all cell values (will skip first raw of each sheet that is actually a heading) to TEXT file.

    More importantly each sheet contains at least one column that contains values that need to be placed in the text file under single quotes. ('cell_value'). Other values don't need to be under quotes.

    Also I need to automatically add some comments (header) into newly created excel file bu running a macro.

    Out put file should look something like this:

    Comment
    Comment
    Sheet1.Value1, Sheet1.'VALUE2', Sheet1.Value3, Sheet1.Value4
    Sheet1.Value1, Sheet1.'VALUE2', Sheet1.Value3, Sheet1.Value4
    End of First Sheet Values

    Comment
    Sheet2.Value1, Sheet2.'VALUE2', Sheet2.Value3, Sheet2.Value4
    Sheet2.Value1, Sheet2.'VALUE2', Sheet2.Value3, Sheet2.Value4



    I am really having problems to understand and create this macro. I need it badly so any help would be highly appreciated!

    Thanks!!!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Save a range of sheets to TEXt file

    Try something like this...

    Please Login or Register  to view this content.
    Martin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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