Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is the start:
Sub findmerged() Dim c For Each c In ActiveSheet.UsedRange If c.MergeCells Then MsgBox c.Address & " is merged" End If Next End Sub Sub Unmerge() Dim rng As Range, rngtot As Range, rngval As Variant Dim strtrow As Long, endrow As Long, col As Long strtrow = Selection.Row col = Selection.Column endrow = Application.WorksheetFunction.Min(Selection.End(xl Down).Row - 1, Cells(65536, col).End(xlUp).Row + 1) rngval = Selection.Value Set rngtot = Range(Cells(strtrow, col), Cells(endrow, col)) ActiveCell.Unmerge For Each rng In rngtot rng.Value = rngval Next rng End Sub -- Message posted via http://www.officekb.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the problem you are having? Do you have a question? Indicate where
the error is and what type of error? -- Cheers, Ryan "rtwiss via OfficeKB.com" wrote: This is the start: Sub findmerged() Dim c For Each c In ActiveSheet.UsedRange If c.MergeCells Then MsgBox c.Address & " is merged" End If Next End Sub Sub Unmerge() Dim rng As Range, rngtot As Range, rngval As Variant Dim strtrow As Long, endrow As Long, col As Long strtrow = Selection.Row col = Selection.Column endrow = Application.WorksheetFunction.Min(Selection.End(xl Down).Row - 1, Cells(65536, col).End(xlUp).Row + 1) rngval = Selection.Value Set rngtot = Range(Cells(strtrow, col), Cells(endrow, col)) ActiveCell.Unmerge For Each rng In rngtot rng.Value = rngval Next rng End Sub -- Message posted via http://www.officekb.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
trying to select all merged cells on sheet then unmerge each merge cell and
spread merge data to all cells in each merged cell. You follow? RyanH wrote: What is the problem you are having? Do you have a question? Indicate where the error is and what type of error? This is the start: [quoted text clipped - 25 lines] End Sub -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sort spreadsheet, "merged cells" comes up. Find cells? Unmerge ? | Excel Discussion (Misc queries) | |||
Spreadsheet with merged cells - how can I unmerge the cell and re. | Excel Programming | |||
To safety merge cells without data destroyed, and smart unmerge! | Excel Discussion (Misc queries) | |||
How can I unmerge the merged cells in a Excel sheet quickly? | Excel Programming | |||
Can't unmerge merged cells programatically | Excel Programming |