Fixed-Length .dat file Automatically Parsing

technochik

New Member
Joined
Dec 2, 2005
Messages
15
I have a fixed length .dat external file with no column headings. I know I can import the file into Excel manually via the Text Import Wizard (where I manually specify the field widths of each column...using a printed file layout as reference). I want to automate this though. Is there a way to import the file automatically parsing into standard file layout?

Basically I don't want to have to reformat these files for an end-user every week (the Text Import Wizard is too advanced for them). I am hoping to setup a template, macro or hidden VB script that will reformat this file into the pre-defined columns and add headings. Can this be done?
 
I created a "delete button" macro which works fine. But when I create the "create button" macro, it doesn't capture the text title or assign the macro that I do during the macro recording. Here's the code that's generated:
Application.CommandBars("Standard").Controls.Add Type:=msoControlButton, ID _
:=2950, Before:=22

Can I add code to change the button from a smiley face to a text title? Can I add code to assign the FormatCRC macro to the button?
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I just created a "form" button and assigned the macro there. That should do that trick. Thanks again for your help! I'm eternally grateful.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,047
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top