PC Review


Reply
Thread Tools Rate Thread

AutoFit Row Height with Merged Cells in the Row

 
 
RyanH
Guest
Posts: n/a
 
      19th Mar 2008
I need to add text from a Userform Textbox to a worksheet. Sometimes the
textbox may conatin a few sentences. Unfortunately, the text needs to span
across 3 Columns. I would like my code to put the textbox text into the
merged cells, wrap the text to fit, and automatically adjust the row height.
Is it possible to do this or is there an easier way? The text has to be
contained between Col.C and Col.E.

Sub AutoFitText()

With ActiveCell 'ActiveCell = Range("B10") in this case

'.....I have additional code here

.Offset(30, 1).Value = " • Comments: " & tbxComments

With Range(.Offset(30, 1), .Offset(30, 3))
.Merge
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlCenter
.WrapText = True
.Rows.EntireRow.AutoFit
End With

'.....I have additional code here as well

End With

Thanks in Advance,
Ryan

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Merged cells won't Autofit row height RagDyer Microsoft Excel Misc 20 12th Jan 2010 10:01 PM
RE: Merged cells won't Autofit row height TimS Microsoft Excel Misc 1 19th Jun 2008 02:18 AM
Row height using autofit, with no merged cells =?Utf-8?B?RC5TbWl0aA==?= Microsoft Excel Misc 1 2nd Jul 2006 11:51 AM
Autofit Row Height of Merged Cells =?Utf-8?B?Sm9u?= Microsoft Excel Misc 3 5th Aug 2005 08:15 PM
Autofit row height in merged cells BobT Microsoft Excel Misc 1 25th Feb 2005 04:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 AM.