Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Resizing cells

Status
Not open for further replies.

progressive7

Technical User
Jul 25, 2002
33
GB
i have a sheet with which all the cells are formated to waord wrap. however when a user enters a load of text it does not do the word wrapping untill the cell is manually resized. is there any way to combat this?
 
You can use

Columns("A:A").EntireColumn.AutoFit

where "A" is the desired column to autofit the column to the widest entry. This may not be what you need, however, because you are using word wrap for long entries. If you want to expand acolumn to a certain with, you can use

Columns("A:A").ColumnWidth = 20

replacing the 20 with your desired column width.

Good luck! BlackburnKL
 
I think its is Row.autofit that is required. Autowidth of columns doesn't help much with word wrapped cells. Excel usually tries to autofit when you edit wrapped text anyway but it doesn't always succeed for reasons unknown to me.
 
sorry to appear ingnoragrant but where to i place this code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top