[mso] Re: Excel question
- From: "Ray Blake" <ray@xxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Tue, 30 Sep 2003 06:34:47 +0100
Sandy,
Oddly enough I bumped into exactly the same problem on a project this
week. My research led me to this code which I found in an old issue of
the Excel Experts ezine, here:
http://www.j-walk.com/ss/excel/eee/eee011.txt
Macro by Jim Rech:
Excel does not support automatically adjusting the row height of a
merged
cell with wrap text set. This procedure serves as a workaround.
Sub AutoFitMergedCellRowHeight()
Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
Dim CurrCell As Range
Dim ActiveCellWidth As Single, PossNewRowHeight As Single
If ActiveCell.MergeCells Then
With ActiveCell.MergeArea
If .Rows.Count = 1 And .WrapText = True Then
Application.ScreenUpdating = False
CurrentRowHeight = .RowHeight
ActiveCellWidth = ActiveCell.ColumnWidth
For Each CurrCell In Selection
MergedCellRgWidth = CurrCell.ColumnWidth +
MergedCellRgWidth
Next
.MergeCells = False
.Cells(1).ColumnWidth = MergedCellRgWidth
.EntireRow.AutoFit
PossNewRowHeight = .RowHeight
.Cells(1).ColumnWidth = ActiveCellWidth
.MergeCells = True
.RowHeight = IIf(CurrentRowHeight > PossNewRowHeight, _
CurrentRowHeight, PossNewRowHeight)
End If
End With
End If
End Sub
It worked for me.
Ray Blake
_____________
This email is from Ray Blake, Head of Software Design, GR Business
Process Solutions. It is confidential and intended for the addressee
only. The contents are private and may be legally privileged. If you
receive this email in error we would be grateful if you would advise the
sender and delete the email from your system.
For more information on the services that we offer please visit us at
our website: - www.grbps.com
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Sandy Crowley
Sent: 29 September 2003 21:32
To: mso@xxxxxxxxxxxxx
Subject: [mso] Excel question
I have created an Excel form for Employee Reviews.
Comment Cell is a cell that has been merged across the width of the
document and sized to a specific height.
Problem: When a user types in the cell, the cell doesn't expand with the
text even though I have the "wrap text" box checked for that cell.
Has anyone run into this issue and how did you solve or work around it?
Thanks.
Sandy Crowley, SDA, CDT
Director of Administration | Senior Associate
Little Diversified Architectural Consulting
5815 Westpark Drive | Charlotte, NC 28217
D:704.561.5135 | M:704.408.0458 | F:704.561.8734
www.littleonline.com <http://www.littleonline.com/>
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the
quotes) in the subject line.
Or, visit the group's homepage and use the dropdown menu. This will
also allow you to change your email settings to digest or vacation (no
mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions. Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
- References:
- [mso] Excel question
- From: Sandy Crowley
Other related posts:
- » [mso] Excel question?
- » [mso] Re: Excel question?
- » [mso] Re: Excel question?
- » [mso] Re: Excel question?
- » [mso] Re: Excel question?
- » [mso] Re: Excel question?
- » [mso] Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Re: Excel question
- » [mso] Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Re: Excel question.
- » [mso] Excel question - John Perrin
- » [mso] Re: Excel question - Thomas Hutchins
- » [mso] Re: Excel question - David Smart
- [mso] Excel question
- From: Sandy Crowley