Hi, I’m having difficulty writing a script that finds merged cells in an Excel sheet, unmerges them, and copies the value of the merged cell to each of the unmerged cells. I found a macro that does this on the interwebs:
Sub FindMergedCellsUnmergeThemAndFillThem()
Dim MergedCell As Range, FirstAddress As String, MergeAddress As String, MergeValue As Variant
Application.FindFormat.MergeCells = True
Do
Set MergedCell = ActiveSheet.UsedRange.Find("", LookAt:=xlPart, SearchFormat:=True)
If MergedCell Is Nothing Then Exit Do
MergeValue = MergedCell.Value
MergeAddress = MergedCell.MergeArea.Address
MergedCell.MergeArea.UnMerge
Range(MergeAddress).Value = MergeValue
Loop
Application.FindFormat.Clear
End Sub
However, I need to do the same thing with an AppleScript that works with Excel 2008 or newer. Does anyone have a solution?
Thanks,
Garry