Auto Fit

Trevor2002

Board Regular
Joined
Oct 23, 2002
Messages
52
Hello,
I have cells A1:H1 merged into one cell and set to wrap text. In this cell I need to type a text message, sometimes the message will fit in these merged cells and sometimes it won't depending on the size of the message. I would like to expand row 1 automatically, if needed to accommodate the size of the message. I tried auto fit and can't seem to get it to work.
Thanks Trevor2002
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try this: Right click the sheet tab and select View Code, paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then Target.Columns.AutoFit
End Sub

then close the code window using the X.
 
Upvote 0

Forum statistics

Threads
1,190,996
Messages
5,984,060
Members
439,872
Latest member
noaman79

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
Top