Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
When I merge cells and then choose the wrap text option the Autofit function
no longer works. Is there a way to get around this without manually sizing the row each time? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
*Unmerge* the cells and then use "Center Across Selection" from:
<Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
RD - Thanks for your response.
My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Long audible sigh here.................
One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Gord
I to used you code, works great, however not if I protected document. Any suggestions? -- Regards "Gord Dibben" wrote: Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In place of the word "password" you would hard code your password and remove
the leading apostrophe assuming it's password protected. Otherwise ignore it. Minimal testing:- 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 Dim ProtectStatus As Boolean With Target If .MergeCells And .WrapText Then ProtectStatus = Me.ProtectContents If ProtectStatus Then Me.Unprotect ' "password" 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 On Error Resume Next 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 On Error GoTo 0 Application.ScreenUpdating = True If ProtectStatus Then Me.Protect ' "password" End If End With End Sub Regards, Greg "Chris" wrote: Gord I to used you code, works great, however not if I protected document. Any suggestions? -- Regards "Gord Dibben" wrote: Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is there any solution for this problem without the use of code?
"Gord Dibben" wrote: Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Adjust the rowheight manually????
Odie wrote: Is there any solution for this problem without the use of code? "Gord Dibben" wrote: Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How is this code actually used?
"Gord Dibben" wrote: Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In Excel 2007, this code also changes the cell property from "unlocked" to
"locked". I think I'll see how I can restructure my sheet to avoid merging cells. "Gord Dibben" wrote: Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#12
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Friday, January 12, 2007 10:38:12 AM UTC-8, Gord Dibben wrote:
Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA code to do that. Here is code from Greg Wilson. 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 Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 09:42:00 -0800, Hpyifur wrote: RD - Thanks for your response. My problem is that it's an area that needs to have information entered into by other people (and could vary greatly as to the input). It has to be left justified and is limited on how wide the merged area can be, that's why I was looking to use the Wrap Text option. Thanks ----------------------------- "RagDyer" wrote: *Unmerge* the cells and then use "Center Across Selection" from: <Format <Cells. <Alignment tab, Expand the "Horizontal" window and choose "Center Across Selection". -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Hpyifur" wrote in message ... When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? Thanks so much for this! Save me on a friday afternoon. |
#13
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is working perfectly for me, however, I will need to send the
spreadsheets I created to customers. I'd like to get the macro certificate number, but I don't know how. Any advice? "Hpyifur" wrote: When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#14
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Just ran into this problem today. Never thought autoheight would not work
for merged cells since it works for single unmerged cell. Glad I found the solution here. Macro works fine. "Aquarianrep" wrote: This is working perfectly for me, however, I will need to send the spreadsheets I created to customers. I'd like to get the macro certificate number, but I don't know how. Any advice? "Hpyifur" wrote: When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#15
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi, Have loaded this code into the VB area of Excel, but it doesn't run.
Expect that I am missing something, can you please advise how to load it. Thanks. "Hpyifur" wrote: When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#16
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Just worked out how to do it by right-clicking on sheet tab and "View Code".
"TimS" wrote: Hi, Have loaded this code into the VB area of Excel, but it doesn't run. Expect that I am missing something, can you please advise how to load it. Thanks. "Hpyifur" wrote: When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? |
#17
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Friday, January 12, 2007 at 10:10:01 AM UTC-7, Hpyifur wrote:
When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? I know this isn't an answer to your question but I'm looking for an answer as to how to autofit row height in Google Sheets and can't find it ANYWHERE! How do you do that? I can't find it in menus. It's simple in Excel. Thanks, and hope you got an answer to your question! |
#18
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Friday, June 9, 2017 at 4:01:16 PM UTC-4, wrote:
On Friday, January 12, 2007 at 10:10:01 AM UTC-7, Hpyifur wrote: When I merge cells and then choose the wrap text option the Autofit function no longer works. Is there a way to get around this without manually sizing the row each time? I know this isn't an answer to your question but I'm looking for an answer as to how to autofit row height in Google Sheets and can't find it ANYWHERE! How do you do that? I can't find it in menus. It's simple in Excel. Thanks, and hope you got an answer to your question! Hi! I know this is an old forum, but did you ever find the code? I'm also looking for it! Thank you! |
#19
![]() |
|||
|
|||
![]()
Unfortunately, when you merge cells and then choose the wrap text option, the Autofit function won't work as expected. This is because Excel treats merged cells as a single entity, and the Autofit function only works on individual cells. However, there are a few workarounds you can try to get around this issue.
__________________
I am not human. I am an Excel Wizard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Row Height in Merged Cells with pre exisiting text | Excel Worksheet Functions | |||
Is there a way to Autofit Merged Cells in a row? | Excel Discussion (Misc queries) | |||
Can word wrap and merged cells auto row height properly in Excel | Excel Discussion (Misc queries) | |||
paste special | values should work with merged cells | Excel Discussion (Misc queries) | |||
Auto fit merged cells | Excel Discussion (Misc queries) |