Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Solution To Auto Height For Merged Cells


If anyone is interested, I found a way to automatically adjust a row
height based on merged cells text. Here's how I did it...

In a cell unmerged and on the same row as the merged cells, enter the
formula = merged cells and set the formula cell to the same column
width as the combined merged cells. For example: Merged cells are
B2:D2, formula in F2 is "=B2". Then set column F width to match merged
cells. So if the merged cells combined column width is 30, set column F
width 30.

Then in the worksheet VBA, use this code. This will automatically
adjust the row height after the text in cell B2 is entered.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 2 Then
ActiveSheet.Rows(2).AutoFit
End If
End Sub

Happy VBAing.


--
JoJo
------------------------------------------------------------------------
JoJo's Profile: http://www.excelforum.com/member.php...o&userid=11307
View this thread: http://www.excelforum.com/showthread...hreadid=572423

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Row Height with Wrapped Text in Merged Cells Problem Rick Cl. Excel Discussion (Misc queries) 3 June 3rd 10 11:21 PM
How to enable auto height with merged cells? lgreggs Excel Worksheet Functions 0 March 18th 10 03:29 PM
Auto Row Height in Merged Cells with pre exisiting text gwinder Excel Worksheet Functions 2 December 14th 06 05:31 PM
Can word wrap and merged cells auto row height properly in Excel wchernock Excel Discussion (Misc queries) 1 May 30th 06 03:04 PM
Auto Row Height for Merged Cells Jamie Excel Programming 13 July 1st 05 12:55 AM


All times are GMT +1. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"