+ Reply to Thread
Results 1 to 5 of 5

Import Fixed Length File

  1. #1
    Registered User
    Join Date
    12-06-2007
    Posts
    3

    Import Fixed Length File

    I have one specific file that is generated by our student management system in a fixed-length format and I am regularly importing it to Excel to make manual changes to certain elements.

    What I would like to do is automate the process of importing. Is there a way to have Excel grab this file, put the first character in column one and make the width of that column "1", put the next two characters into column 2 and make the width of column 2 "2", put the next 13 characters in column 3 and make the length "13", etc., etc.?

    Can this be done with Visual Basic scripting?

    Any assistance is appreciated.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You have not sais what type of file it is - Text, Csv etc

    Have you tried recording a macro whilst importing (opening) the file?
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    12-06-2007
    Posts
    3
    Quote Originally Posted by mudraker
    You have not sais what type of file it is - Text, Csv etc

    Have you tried recording a macro whilst importing (opening) the file?

    It is basically a text file. I have not tried recording a macro. I certainly can give it a shot.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Once you have recorded your macro if you need changes made post the code

    The recorded macro will have the file name & path hard coded, If you use mutliple file names that is one item that you will want to get changed

  5. #5
    Registered User
    Join Date
    12-06-2007
    Posts
    3
    Worked like a champ.

+ 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