我正在尝试在不断变化的位置选择一组行进行合并。我似乎无法弄清楚。我已经在谷歌搜索了半个小时,尝试了不同的方法。这样我就可以合并和格式化新组合的 9 个单元格。它已经在一个按钮下,并且将从用户表单中提取信息。我正在寻找的是如何设置范围。我愿意接受所有建议,提前感谢。
Worksheets("CompList").Cells(Rows.Count, 1).End(xlUp).Select 'selects last row of information in row "A"
Cells(Selection.Row + BusHeight, Selection.Column).Select 'adds number of lines for business to add to get next empty slot
Selection.Value = 1 'listdivision.Value
Range(Cells(Selection.Row, Selection.Column), Cells(Selection.Row + 1, Selection.Column), Cells(Selection.Row + 1, Selection.Column), Cells(Selection.Row + 1, Selection.Column), Cells(Selection.Row + 1, Selection.Column), Cells(Selection.Row + 1, Selection.Column), Cells(Selection.Row + 1, Selection.Column), Cells(Selection.Row + 1, Selection.Column)).Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With