您好,我想将第 1 行的七个单元格合并在一起。我想我可以通过宏来实现这一点,而不是单击 A1 按 shift,然后按右箭头键六次。我已经写了以下内容,但不确定如何在字母参考中添加 7,尤其是当我进入以 AA1 结尾的最后七个时,它会启动 AA2 并继续。下面的代码实现了我想要的,但是我如何引入变量和一个循环来将字母存储为 int,加六,然后转换回字符串并继续下一组?我该怎么写While (End of row has not been reached)
Range("A1:G1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("H1:N1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With