How to avoid default Column Width

pfb46

New Member
Joined
Feb 6, 2011
Messages
2
I create files on a mainframe that are both fixed-length AND delimited (usually semi-colon) and load them into Excel as .txt. I bring them into Excel as delimited but have to individually adjust COLUMN width. Since I frequently have 20 or more columns, this is tedious. I know there must be a way that Excel can figure out my lengths, but I don't know what am I doing wrong (either in Excel or upload from mainframe). Thanks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Import your data
Select your data (or select everything)
Data - Text to columns - delimited - next
check whatever your delimiters are (semicolons or whatever) in the list or add new ones at the end
Finish

Should do what you want
 
Upvote 0
Just re-read your question I guess you got the data in OK but the column widths are wrong?

In 2007 you can get Excel to auto format the columns by selecting your data and then in the home tab under cells click format - autofit column width and that shoudl do it

The functionality is there in earlier versions too - I think under Format but I cant quite remember where (amazing 6 months and you forget everything!)
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

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