Unmerging cells - text

marilyn123

New Member
Joined
Aug 15, 2016
Messages
15
I have a merged cell with a single line of text in it going for example from A1:A10. I would like to unmerge these cells but have that line of text populate each cell. Otherwise we have to unmerge/copy/paste over and over again.

is there a way to do this? the below is what I would want it to look like when I'm done.

[TABLE="width: 500"]
<tbody>[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
[TR]
[TD]text[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Assuming your text uses spaces as the delimiter separating words and is in range A1:A10 which is merged, this should produce the result you want.
Code:
Sub UnMergeDown()
Dim S As Variant
Application.ScreenUpdating = False
With Range("A1:A10")  ' change range to suit
    If Not .MergeCells Then Exit Sub
    S = Split(.Cells(1, 1).Value, " ")
    .UnMerge
    .Cells(1, 1).Resize(UBound(S) + 1).Value = Application.Transpose(S)
End With
Application.ScreenUpdating = False
End Sub
 
Upvote 0
Code:
Sub MergeUnmerge()


    Dim objData As Object
    Dim arr As Variant
    
    Range("A1").UnMerge
    Set objData = CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
    With objData
        .SetText Range("A1").Text
        .PutInClipboard
        arr = Split(.GetText, Chr(10))
    End With
    Range("A1").Resize(UBound(arr) + 1) = Application.Transpose(arr)


End Sub
 
Upvote 0
I just found this link which would actually work perfectly for what I'm doing. I just need to go it to work for me, dont' know if it's because I'm using 2010 instead of an older version. When I get to the part where it says to use the up arrow, nothing happens. Any help?

Also, using VBA is not an option right now.

1. Highlight entire range of cells containing blanks and non-blanks

2. Press Ctrl+G (the goto dialogue)

3. Press Special, select blank cells (note, they must truly be blank, not formulas that evaluate to "")

4. Type "=" (sans quotes) and then hit the up arrow.

5. Press Cltr+Enter to input that formula into all currently selected blank cells.

DONE
 
Upvote 0
I just found this link which would actually work perfectly for what I'm doing. I just need to go it to work for me, dont' know if it's because I'm using 2010 instead of an older version. When I get to the part where it says to use the up arrow, nothing happens. Any help?

Also, using VBA is not an option right now.

1. Highlight entire range of cells containing blanks and non-blanks

2. Press Ctrl+G (the goto dialogue)

3. Press Special, select blank cells (note, they must truly be blank, not formulas that evaluate to "")

4. Type "=" (sans quotes) and then hit the up arrow.

5. Press Cltr+Enter to input that formula into all currently selected blank cells.

DONE
After Step #3... are there any cells highlighted?
 
Upvote 0
I just found this link which would actually work perfectly for what I'm doing. I just need to go it to work for me, dont' know if it's because I'm using 2010 instead of an older version. When I get to the part where it says to use the up arrow, nothing happens. Any help?

Also, using VBA is not an option right now.

1. Highlight entire range of cells containing blanks and non-blanks

2. Press Ctrl+G (the goto dialogue)

3. Press Special, select blank cells (note, they must truly be blank, not formulas that evaluate to "")

4. Type "=" (sans quotes) and then hit the up arrow.

5. Press Cltr+Enter to input that formula into all currently selected blank cells.

DONE
I don't think the procedure you show here will work for merged cells, and it has nothing to do with the version of Excel you are using. In reading it I went back to your OP and realized that you want to repeat the whole line in each cell - not split the line among the merged cells. I understand you can't use VBA, but for the record, below is revised code that will do what you requested in your OP.

Code:
Sub UnMergeDown()
Application.ScreenUpdating = False
With Range("A1:A10")  ' change range to suit
    If Not .MergeCells Then Exit Sub
    .UnMerge
    .Cells(1, 1).Resize(.Rows.Count).Value = .Cells(1, 1).Value
End With
Application.ScreenUpdating = False
End Sub
 
Upvote 0
Try this:
1. Select the merged cells.
2. Unmerge the cells (Home>Alignment>Merge & Center>Unmerge Cells
3. Hold down Ctrl key and press D key
 
Upvote 0
Code:
Public Sub UnmergeSelection()
  ' Unmerges the selected merged cells
  ' and repeats the value in each cell
  
  Dim MergedCells As Range
  Dim CellValue As Variant
  
  On Error GoTo ErrHandler
  If Not TypeOf Selection Is Range Then
    MsgBox "Selection is not a range of cells.", vbExclamation
    Exit Sub
  End If
  
  ' Null occurs when selection has
  ' both merged and unmerged cells
  If IsNull(Selection.MergeCells) Then
    MsgBox "Selection is not a merged range of cells.", vbExclamation
    Exit Sub
  End If
  
  If Not Selection.MergeCells Then
    MsgBox "Selection is not a merged range of cells.", vbExclamation
    Exit Sub
  End If
  
  Set MergedCells = ActiveCell.MergeArea
  CellValue = MergedCells.Item(1).Value
  MergedCells.Unmerge
  MergedCells.Value = CellValue
  Exit Sub
  
ErrHandler:
  MsgBox Err.Description, vbCritical
End Sub
 
Upvote 0
The only thing odd about my spreadsheet that I notice is that the title of the document says [group] when it's open. If I copy the data to a new workbook, the title of the document still says "Book2 [Group]". Could that be an issue? I have no idea why that is.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top