![]() |
|
#2
|
|||
|
|||
|
you can try this macro...(there could be better solutions) ;adjust elements in red to fit:
Sub getFontsize() Dim i As Integer Application.ScreenUpdating = False For i = 1 To 15 Rows(i).Select Selection.RowHeight = 2 * (ActiveSheet.Cells(i, 1).Font.Size + 5) With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False If Len(ActiveSheet.Cells(i, 1)) > 30 Then .Rows.AutoFit End If End With Next i Application.ScreenUpdating = True End Sub Attention: if you use merged cells, or if your cells containing formulas, it will not work properly |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro or user function to Extract row height | Catalin.B | Excel | 12 | 06-22-2011 09:21 AM |
| Pasting HTML into Excel (height auto-adjust) | c-tran | Excel | 0 | 03-11-2010 07:30 AM |
One to many and many to one question
|
Girlie4 | Excel | 3 | 08-09-2009 08:02 PM |
| Validate the height of the text when you save (VBA) | jhpe | Word VBA | 0 | 08-22-2008 06:59 PM |
| Categories question & replying with attachment question | glitzymama | Outlook | 0 | 03-15-2006 09:32 AM |