+ Reply to Thread
Results 1 to 2 of 2

Thread: Importing and formatting txt files

  1. #1
    Registered User
    Join Date
    11-02-2010
    Location
    Sunrise, FL
    MS-Off Ver
    Excel 2003
    Posts
    6

    Importing and formatting txt files

    I am using the code below to open txt files. But prior to importing I would like to format them as comma delimited. What would the code be to accomplish this before actually opening the workbook?


    Sub OpenMultipleFiles()
    Dim fn As Variant, f As Integer
    fn = Application.GetOpenFilename("Excel-files,*.xls", _
    1, "Select One Or More Files To Open", , True)
    If TypeName(fn) = "Boolean" Then Exit Sub
    For f = 1 To UBound(fn)
    Workbooks.Open fn(f)
    Next f
    End Sub

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: Importing and formatting txt files

    Always include link to your same question on other forums when you post on multiple forums. It's courteous, and around here it's the law.

    Crossposted:
    http://www.mrexcel.com/forum/showthread.php?t=506223
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

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