+ Reply to Thread
Results 1 to 3 of 3

Thread: Exporting selection to tab delimited text file

  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    97

    Exporting selection to tab delimited text file

    Hi,

    I have a worksheet (In a workbook with several sheets) that I want to save to a tab delimited text file.

    I want to include the full range of data on the worksheet except the header row.

    Currently I can't even figure out how to achieve this without a macro, so I've not even been able to record and modify the action.

    Any help?

    Many thanks
    Last edited by jlt199; 09-23-2010 at 07:29 AM.

  2. #2
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Exporting selection to tab delimited text file

    Something like this:

    Sub test()
    
    ActiveSheet.Copy
    
    Rows(1).Delete
    
    ActiveWorkbook.SaveAs Filename:="C:\Export.txt", FileFormat:=xlText
    
    ActiveWorkbook.Close False
    
    End Sub

    If you want to specify a specific sheet the first line would be something like:

    Sheets("Sheet1").Copy

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    03-19-2010
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    97

    Re: Exporting selection to tab delimited text file

    Perfect!!

    Thanks :D

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0