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.
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
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post
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.
Originally Posted by mudraker
It is basically a text file. I have not tried recording a macro. I certainly can give it a shot.
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
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1