Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    Near Chicago, Illinois, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Extract text to a file (2000)

    I have an excel file with a LOT of data in it. In order to use the data, I need to extract portions to separate files, in the form of text. I could put each set of data on a separate worksheet and then save each sheet as a text file, and go through all those clicks saying "Yes, I know that functions are lost".

    I have also highlighted the text and cut-and-pasted to Wordpad, saving each file separately. But that gets really old after while.

    Is there any way to highlight a bunch of cells, and then directly save it to a text file? I don't really care if it is space, tab, or comma-delimited.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Extract text to a file (2000)

    One way, takes a little bit of set up, is via Contol Panel | Printers, to install the Windows 'Generic/Text Only' Printer Driver with the port set as 'Print to a File'. Then in the spreadsheet set the area that you want to save to text as a print area, select Print, select the Generic/Text Only printer, name the file (you have to provide full path inofrmation), and presto. Some things, such as portrait or landscape layout, and headers and footers, may leave your text file looking a bit wonky.

    After you set it up you could attach this simple macro to a TB Button for easy access, then you won't need to set the print area, just select the range:

    Sub PrintToTxtFile()
    On Error Resume Next ' if you cancel out or don't specify a valid file name
    Selection.PrintOut Copies:=1, ActivePrinter:="Generic / Text Only on FILE:"
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Extract text to a file (2000)

    You could write VBA code to write the selected cells to a text file in any format you want them in.
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •