Question:
About expanding Excel cells horizontally?
1970-01-01 00:00:00 UTC
About expanding Excel cells horizontally?
Four answers:
Greg G
2013-06-17 14:18:20 UTC
To have Excel automatically "autofit" your column you'll need VBA for a worksheet change event.



I'm still new to the VBA thing, but this should work:



Copy the code below into your clipboard



Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Cells.Columns.AutoFit

Cells.WrapText = False

End Sub



Now go to Excel, right click on the sheet tab and select View Code

Paste the code into the VBE and close it.



Now, type your text into any cell, and when you press enter or tab out of it, the column will autofit.

It will shrink or expand the column width accordingly.
Flukey
2013-06-17 13:58:32 UTC
It is not actually deleting the text. The text is still there. It is just that the cell to the right takes precedence. You can widen the column so that is is wide enough to take the text. There is not a way of automatically widening columns as you type. In a spreadsheet generally, text should not be too long in any case, as usually it is headings. Depending on the kind of data you are working with, a database may be a better option. Excel is predominantly for numeric data. If you have a lot of text data and not much numeric data then use a database instead.
David
2013-06-17 13:45:07 UTC
either set column width or drag the column edge in the top bar.

If you format column , alignment you can get wrap text which you say you don't want.

But up to the cell size limit, excel is storing into the cell number shown at top left in the data bar - it just looks as though it's moving it along or overtyping cells to the right......
swdarklighter
2013-06-17 10:26:21 UTC
If you type a long sentence or phrase into Excel, it isn't actually merging or combining cells - it just appears that way until you type something into the next cell. Once the cell overflows, it will appear to be cut off when the next cell to the right has a value entered. All the text is still there, it just isn't visible on the worksheet.



To autofit the column width, just double click on the line between the two columns. For example, if your long text is in column A, click on the line between the A and B column header at the very top of the worksheet. You'll see a little vertical line with two arrows when you hover over this line. Just double click and the width for column A will autofit to fit the width of the longest line of text in column A. There is no way of doing this as you type automatically (unless using a VBA as another suggested), but doing the autofit is quite easy, so I wouldn't worry about programming something you can do with a simple mouse click.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...