Re: Auto Resize columns on opening a text file in Excel
Re: Auto Resize columns on opening a text file in Excel
- Subject: Re: Auto Resize columns on opening a text file in Excel
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 07 Dec 2011 18:58:12 -0800
- Thread-topic: Auto Resize columns on opening a text file in Excel
Title: Re: Auto Resize columns on opening a text file in Excel
On 12/7/11 6:27 PM, "Stan Cleveland" <email@hidden> wrote:
On Dec 7, 2011, at 6:10 PM, Spelean wrote:
I'm creating tab delimited text files from a database.
I'd like Excel to auto resize the columns to the max width in each column after opening.
This is akin to selecting all the columns manually and then double clicking the column divider in the header
Is there an inbuilt applescript command that will do this?
something like
set column width of cell "A1:AD1" to (auto) ?
Hi Andrew,
Assuming Excel 2004 or later, this should do the trick:
autofit columns of range "A1:AD1"
And for row height:
autofit rows of range "A1:A25"
HTH,
Stan C.
Yes, even better. You can again avoid even figuring out manually how many columns are being used with
tell application "Microsoft Excel"
autofit (columns of used range of active sheet)
end tell
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden