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?
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.
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.