Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a file where I have merged cells a10:d:10 and formatted it to wrap text.
My problem is that the row-height not changes automatically, which always happends if I wrap text in cells that are not merged. I there any sulotion for this? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The best solution is not to use merged cells - they're far more trouble
than they're worth. If you're merging in order to center a title, do this instead: put the title in A1. Select A1:D1. Choose Format/Cells/Alignment and select "Center Across Selection" from the Horizontal dropdown. If you need to keep the cells merged, then you'll need to use something like this macro by Jim Rech: http://groups.google.com/group/micro...amming/browse_ frm/thread/a5cbe0ee8e6c2a10/93c6bca447bd8902#93c6bca447bd8902 (or http://elfurl.com/2gguv, if the above linewrapped link doesn't work) In article , Lena_Office wrote: I have a file where I have merged cells a10:d:10 and formatted it to wrap text. My problem is that the row-height not changes automatically, which always happends if I wrap text in cells that are not merged. I there any sulotion for this? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Is there any way to get this macro to run automatically while pressing Enter
after typing a long sentence? I get the macro to work, but only if I create a Button to run it from. "JE McGimpsey" skrev: The best solution is not to use merged cells - they're far more trouble than they're worth. If you're merging in order to center a title, do this instead: put the title in A1. Select A1:D1. Choose Format/Cells/Alignment and select "Center Across Selection" from the Horizontal dropdown. If you need to keep the cells merged, then you'll need to use something like this macro by Jim Rech: http://groups.google.com/group/micro...amming/browse_ frm/thread/a5cbe0ee8e6c2a10/93c6bca447bd8902#93c6bca447bd8902 (or http://elfurl.com/2gguv, if the above linewrapped link doesn't work) In article , Lena_Office wrote: I have a file where I have merged cells a10:d:10 and formatted it to wrap text. My problem is that the row-height not changes automatically, which always happends if I wrap text in cells that are not merged. I there any sulotion for this? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Lena
Here is event code from Greg Wilson that runs when you ENTER out of a merged cell. Note: wrap text format must be preset on the merged cells. 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 This is event code. Right-click on the sheet tab and "View Code". Copy/paste the above into that sheet module. Gord Dibben MS Excel MVP On Thu, 15 Mar 2007 06:41:02 -0700, Lena_Office wrote: Is there any way to get this macro to run automatically while pressing Enter after typing a long sentence? I get the macro to work, but only if I create a Button to run it from. "JE McGimpsey" skrev: The best solution is not to use merged cells - they're far more trouble than they're worth. If you're merging in order to center a title, do this instead: put the title in A1. Select A1:D1. Choose Format/Cells/Alignment and select "Center Across Selection" from the Horizontal dropdown. If you need to keep the cells merged, then you'll need to use something like this macro by Jim Rech: http://groups.google.com/group/micro...amming/browse_ frm/thread/a5cbe0ee8e6c2a10/93c6bca447bd8902#93c6bca447bd8902 (or http://elfurl.com/2gguv, if the above linewrapped link doesn't work) In article , Lena_Office wrote: I have a file where I have merged cells a10:d:10 and formatted it to wrap text. My problem is that the row-height not changes automatically, which always happends if I wrap text in cells that are not merged. I there any sulotion for this? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks!
Now I understand. "Gord Dibben" skrev: Lena Here is event code from Greg Wilson that runs when you ENTER out of a merged cell. Note: wrap text format must be preset on the merged cells. 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 This is event code. Right-click on the sheet tab and "View Code". Copy/paste the above into that sheet module. Gord Dibben MS Excel MVP On Thu, 15 Mar 2007 06:41:02 -0700, Lena_Office wrote: Is there any way to get this macro to run automatically while pressing Enter after typing a long sentence? I get the macro to work, but only if I create a Button to run it from. "JE McGimpsey" skrev: The best solution is not to use merged cells - they're far more trouble than they're worth. If you're merging in order to center a title, do this instead: put the title in A1. Select A1:D1. Choose Format/Cells/Alignment and select "Center Across Selection" from the Horizontal dropdown. If you need to keep the cells merged, then you'll need to use something like this macro by Jim Rech: http://groups.google.com/group/micro...amming/browse_ frm/thread/a5cbe0ee8e6c2a10/93c6bca447bd8902#93c6bca447bd8902 (or http://elfurl.com/2gguv, if the above linewrapped link doesn't work) In article , Lena_Office wrote: I have a file where I have merged cells a10:d:10 and formatted it to wrap text. My problem is that the row-height not changes automatically, which always happends if I wrap text in cells that are not merged. I there any sulotion for this? |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
No happines lasts forever! When I started to work in my file, someting new
showed up. After entering a text, which wraps perfectly I need to Delete the content in the cell, and presses Delete. Excel gives me the message that the cell I try to change is locked. For some reason, that I can not understand, the merged cell that from the start is formatted "not locked" now is formated like the cell both is locked and not (the square is grey). This also happends when I unmerge and then merge manually. It is not logical since it works fore some merged cells but not for all in the same worksheet. If anyone understands what I am trying to explain, please help! "Lena_Office" skrev: Thanks! Now I understand. "Gord Dibben" skrev: Lena Here is event code from Greg Wilson that runs when you ENTER out of a merged cell. Note: wrap text format must be preset on the merged cells. 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 This is event code. Right-click on the sheet tab and "View Code". Copy/paste the above into that sheet module. Gord Dibben MS Excel MVP On Thu, 15 Mar 2007 06:41:02 -0700, Lena_Office wrote: Is there any way to get this macro to run automatically while pressing Enter after typing a long sentence? I get the macro to work, but only if I create a Button to run it from. "JE McGimpsey" skrev: The best solution is not to use merged cells - they're far more trouble than they're worth. If you're merging in order to center a title, do this instead: put the title in A1. Select A1:D1. Choose Format/Cells/Alignment and select "Center Across Selection" from the Horizontal dropdown. If you need to keep the cells merged, then you'll need to use something like this macro by Jim Rech: http://groups.google.com/group/micro...amming/browse_ frm/thread/a5cbe0ee8e6c2a10/93c6bca447bd8902#93c6bca447bd8902 (or http://elfurl.com/2gguv, if the above linewrapped link doesn't work) In article , Lena_Office wrote: I have a file where I have merged cells a10:d:10 and formatted it to wrap text. My problem is that the row-height not changes automatically, which always happends if I wrap text in cells that are not merged. I there any sulotion for this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto adjusting merged cells with wrap text on | Excel Discussion (Misc queries) | |||
text wrap in merged cells | Excel Discussion (Misc queries) | |||
text wrap w/ merged cells | Excel Discussion (Misc queries) | |||
Rows with merged cells are not adjusting even w/ Wrap Text and au. | Excel Discussion (Misc queries) | |||
How do I "Wrap Text" & "Autofit" within Merged Cells in Excel? | Excel Worksheet Functions |