Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Export Text File to Exclamation Delimited Format (XP)

    Is it possible to export to a text file using an "Exclamation Point" !? One would think that if one can import based on this delimiter one should be able to export in the same manner. Or any other delimiter.

    Thanks,
    John

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

    Re: Export Text File to Exclamation Delimited Format (XP)

    You would have to write VBA code to write the file using the exclamation as a delimiter.
    Legare Coleman

  3. #3
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Text File to Exclamation Delimited Format (XP)

    The short answer is not as a native output form.

    However, it would be a straightforward VBA routine <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    (editted to put all fields in quotes, and make sure we don't overwrite non-xls files)

    Sub WriteExclamationFile()
    Dim MyFile As String
    Dim I As Long, J As Long, MaxCol As Long
    MyFile = Replace(ActiveWorkbook.FullName, ".xls", "")
    Open MyFile & ".esv" For Output As #1
    MaxCol = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
    For I = 1 To ActiveSheet.Cells.SpecialCells(xlLastCell).Row
    For J = 1 To MaxCol - 1
    Print #1, """" & Cells(I, J).Value & """!";
    Next J
    Print #1, """" & Cells(I, MaxCol).Value & """"
    Next I
    Close #1
    End Sub

Posting Permissions

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