此图像显示了我基本上想做的事情
我有很多需要在将数据插入SQL数据库之前准备的excel文件,步骤之一是取消合并excel单元并复制数据,我正在使用c#进行此文档解析我找到了VBA Macro Excel here
的解决方案Sub UnMergeFill()
Dim cell As Range, joinedCells As Range
For Each cell In ThisWorkbook.ActiveSheet.UsedRange
If cell.MergeCells Then
Set joinedCells = cell.MergeArea
cell.MergeCells = False
joinedCells.Value = cell.Value
End If
Next
End Sub
但是我需要使用microsoft.office.interop.excel在C#上完成有谁知道有没有办法做到这一点?