Merge Cell + Text Warp

eagle028

New Member
Joined
May 28, 2005
Messages
49
eg: Column C-H of row 2 are merged. I need the following format for the merged cell:
(1) text wrap and (2) auto expand row height if more text is required in the merged cells. is this achievable?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

eagle028

New Member
Joined
May 28, 2005
Messages
49
i am trying to set up a template. Hence it would be good if the text wrap and row height adjustments are automatic. anyway to write a macro for it?
 
Upvote 0

Stormseed

Banned
Joined
Sep 18, 2006
Messages
3,274
Hi,
I gather that you want to make the row height and column width automatic for a cell or range of cells on your excel worksheet. Please ensure that you turn on the Wrap Text property of these cells prior to copying this code on your worksheet:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Application.Intersect(Target, Range("A1:H100")) Is Nothing Then
Rows("1:100").AutoFit

End If
End Sub

You should copy this code in the worksheet selection change event in order to make it automatic. I hope you know how to go about doing that on your worksheet else you could post back.
 
Upvote 0

eagle028

New Member
Joined
May 28, 2005
Messages
49
Could you explain the last part. I cannot seem to get it done.
 
Upvote 0

eagle028

New Member
Joined
May 28, 2005
Messages
49
Thanks for the codes.......they look too complicated for me. i've choosen to use the easier method of not merging the cell.
Thanks.
 
Upvote 0

Forum statistics

Threads
1,190,759
Messages
5,982,760
Members
439,794
Latest member
rhonllanders

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