跨越合并是一个range中的每行的各个单元格合并,合并单元格则只是range合并成一个单元格,
在vba中的表现:
跨越合并: Selection.Merge True
合并单元格: Selection.Merge false
合并单元格的实际执行的代码则是:
With Selection
.HorizontalAlignment =
xlCenter'水平居中
.VerticalAlignment =
xlCenter'垂直居中
.WrapText =
True'折行...这些其实是基于对象原来的属性,之所以重复执行一下大概是为了设定相关按钮的状态?
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells =
False'此处原本就是分裂的行再执行一下,可能就是为了使相关按钮的状态一致?
End With
Selection.Merge
在vba中的表现:
跨越合并: Selection.Merge True
合并单元格:
合并单元格的实际执行的代码则是:
