+ Reply to Thread
Results 1 to 2 of 2

save excel file from a table delimited file (.txt) using macros

  1. #1
    sedamfo
    Guest

    save excel file from a table delimited file (.txt) using macros

    Hi to you all

    I have files in tab delimited file and I want to save them as excel
    files.
    Since I'll have to do this for many files, I want to use a macro
    I used the record macro function and got a code that works, but the
    problem is that it always saves the same name - and what I want is to
    the file to be saved using the same file name as the file is active,
    something like ActiveWorkbook in line 2? (it doesn't work but it would
    be something like that...)

    ActiveWorkbook.SaveAs FileName:= _
    "Macintosh HD:Myfile.xls" _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False



    I have looked for a while in the postings archives, but couldn't find
    anything. there's a lot of stuff so I could have easily have missed it.
    thanks for your help and patience


  2. #2
    galimi
    Guest

    RE: save excel file from a table delimited file (.txt) using macros

    Try executing the following code in a module

    Sub saveTab()
    Dim wb As Workbook

    For Each wb In Workbooks
    intCounter = intCounter + 1
    wb.SaveAs wb.Name & " Tab Delimited Number " & intCounter & ".xls",
    xlFormat

    Next

    End Sub

    http://HelpExcel.com
    "sedamfo" wrote:

    > Hi to you all
    >
    > I have files in tab delimited file and I want to save them as excel
    > files.
    > Since I'll have to do this for many files, I want to use a macro
    > I used the record macro function and got a code that works, but the
    > problem is that it always saves the same name - and what I want is to
    > the file to be saved using the same file name as the file is active,
    > something like ActiveWorkbook in line 2? (it doesn't work but it would
    > be something like that...)
    >
    > ActiveWorkbook.SaveAs FileName:= _
    > "Macintosh HD:Myfile.xls" _
    > FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    > ReadOnlyRecommended:=False, CreateBackup:=False
    >
    >
    >
    > I have looked for a while in the postings archives, but couldn't find
    > anything. there's a lot of stuff so I could have easily have missed it.
    > thanks for your help and patience
    >
    >


+ 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