Excel Vba拆分并填充单元格
程序员文章站
2024-03-04 16:54:29
...
https://www.cnblogs.com/icedream/archive/2013/03/05/2945158.html
Sub 拆分并填充单元格()
'
' 拆分并填充单元格 宏
'
' 可以将选中的所有单元格都拆开并填充
'
If Application.Selection.MergeCells = True Then
Set selectedRange = Application.Selection
selectedRange.UnMerge
selectedRange.Value = selectedRange.Cells(1, 1).Value
Else
For Each selectedCell In Application.Selection
If selectedCell.MergeCells = True Then
Set selectedRange = selectedCell.MergeArea
selectedRange.UnMerge
selectedRange.Value = selectedRange.Cells(1, 1).Value
End If
Next
End If
End Sub
记录一下,免得每次都找。
上一篇: LeetCode344(反转字符串)
下一篇: crontab修改默认编辑器