I know it sounds simple, but I'm having no luck with it...
How do you autofit, specifically row height, on a merged cell?
Thank you!
I know it sounds simple, but I'm having no luck with it...
How do you autofit, specifically row height, on a merged cell?
Thank you!
a quick search in google makes me think it's a problem of mankind
http://groups.google.com/group/micro...c6bca447bd8902
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
If the merged cells are on the same row, you might try 'Centre across selection' for the horizontal alignment instead of merging the cells, and 'wrap text' checked. Then double click the lower border of the row's label?
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
Thank you so much for your time. I will try these out tomorrow!
The google link gave me an error message, but I did fild this code from Greg Wilson, which works great except if you have two merged cells in the same row (I have no control over the format, so I can't delete the dread merged cells). If you have a11 & b11 merged and c11 & d11, it's going to size the row height according to the last change event, not the larger of the merged cells. Does anyone have any ideas around this? Thanks again!!!
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range
With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub